Page MenuHomePhabricator

Notification received from metawiki instead of target site when group modified on metawiki
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Have a user's group on another site been modified on meta-wiki using User:XXX@anotherwiki
  • Check the notification received by the target user

What happens?:

  • If this user has enabled "Cross-wiki notifications" feature in their preference, they will receive a notification said their permission group on metawiki has been changed
  • On meta-wiki, there will be such notification, but when clicking the "public log" link inside, it will show nothing from log

What should have happened instead?:
No Notification should be send (cross-wiki group changes are not supported, T53540)

Other information (browser name/version, screenshots, etc.):

image.png (820×1 px, 79 KB)
image.png (341×997 px, 31 KB)
screenshot on target wikiscreenshot on meta-wiki

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I've tested this in production via this logentry (now that T344391 is fixed) and I can confirm this is still an active issue:

image.png (416×1 px, 67 KB)

Inside the code there is

		if ( $userId->getWikiId() !== WikiAwareEntity::LOCAL ) {
			// TODO: Support external users
			return;
		}

which can not longer true after https://gerrit.wikimedia.org/r/c/mediawiki/core/+/944188 because the hook is now called with a User object., which is always local.
I would expect that before this change there was no notification, now there are notification on meta about the user right change on the foreign wiki (without notice about that). Both are not good situations.

Maybe the type hint from https://gerrit.wikimedia.org/r/c/mediawiki/core/+/587898 was not the best choose (https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/493e2de56d05f543a18179245aff9be861744026/docs/hooks.txt#3763)
it does not includes the UserRightsProxy class and could not changed to UserIdentity now, but that sounds for the only way to do this.

Hook: https://codesearch.wmcloud.org/search/?q=UserGroupsChanged

Change 950003 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] cross-wiki userrights: Restore hook compatibility

https://gerrit.wikimedia.org/r/950003

[...]
I would expect that before this change there was no notification

That is correct, xwiki rights changes didn't have any notification.

now there are notification on meta about the user right change on the foreign wiki (without notice about that). Both are not good situations.

Ideally, we'd trigger a notification at the foreign wiki, where it would look exactly as a local user rights change notification. But, I imagine that's not going to be trivial.

[...]

Change 950003 merged by jenkins-bot:

[mediawiki/core@master] cross-wiki userrights: Restore hook compatibility

https://gerrit.wikimedia.org/r/950003

Umherirrender claimed this task.