Page MenuHomePhabricator

Special:ListUsers/confirmed doesn't load the list of confirmed users for some users at ptwiki
Closed, ResolvedPublic

Description

https://pt.wikipedia.org/wiki/Special:ListUsers/confirmed does load the list of confirmed users for me when logged under my main account (Martin Urbanec). However, it does not work when I log out, or when I switch to Martin Urbanec (WMF) or Martin Urbanec (test).

Expected behavior

image.png (820×1 px, 177 KB)

Observed behavior (from some accounts)

image.png (988×1 px, 219 KB)

More details

I normally use timeless as my skin (for both my main and WMF accounts), but I switched to Vector. It is broken there as well.

I asked @Tks4Fish if they can reproduce this issue, and it doesn't work for them logged in or logged out. Even weirder, it shows push notification managers for them logged out, while that group isn't supposed to exist in ptwiki at all.

Screenshot by @Tks4Fish

image.png (524×1 px, 308 KB)

I'm honestly unable to provide any theories, this is a quite weird bug. @Pchelolo maybe relevant to recent UserGroupManager refactoring?

See also T275310 for an user-created task, which made me to notice this bug.

Event Timeline

@Pchelolo maybe relevant to recent UserGroupManager refactoring?

All recent UserGroupManager changes were reverted. They are postponed until we use more of Authority.

What's a confirmed user?

@Pchelolo maybe relevant to recent UserGroupManager refactoring?

All recent UserGroupManager changes were reverted. They are postponed until we use more of Authority.

Good to know.

What's a confirmed user?

confirmed is a custom group available at all Wikimedia wikis. It has the same rights as autoconfirmed, but can be granted by bureaucrats (and on some wikis, by sysop). A confirmed user is an user that is a member of this group. This group is set in https://github.com/wikimedia/operations-mediawiki-config/blob/master/wmf-config/CommonSettings.php#L3883.

Just to clarify: it initially worked while logged in. Then Martin asked me to open https://pt.wikipedia.org/wiki/Special:ListUsers/confirmed, which didn't work logged in, but as soon as I refreshed it worked again. It never (recently) worked logged out, though.

...and the information provided in the task description is outdated already, it started to work for my WMF account again. What the hell is happening?

I bet $4 this code in config is to blame:

array_unshift( $wgExtensionFunctions, function () {
	global $wgGroupPermissions;

	$wgGroupPermissions['confirmed'] = $wgGroupPermissions['autoconfirmed'];
	$wgGroupPermissions['confirmed']['skipcaptcha'] = true;
} );

This is from the same series of bugs flagged revisions is suffering from - something somewhere changed and now PermissionManager/UserGroupManager are loaded earlier then extension functions are run. I think it might be CentralAuthPrimaryAuthenticationProvider being loaded and loading permission manager.

T273511 and T273510 will change the initialization sequence in that area, and might magically fix these issues. We were waiting for Authority proposal approval before working on that, I'll make sure to write the code on Monday.

But, in general, this issue will keep reoccurring - mangling permissions from extension function will keep being ignored cause extension functions run very late in the init sequence. We could reset services after running the functions, but that's brutal, that will add a lot to the startup time.

Change 665804 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[operations/mediawiki-config@master] Move confirmed group definition to the end of CS.php

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

Urbanecm triaged this task as High priority.

[...]

This is from the same series of bugs flagged revisions is suffering from - something somewhere changed and now PermissionManager/UserGroupManager are loaded earlier then extension functions are run. I think it might be CentralAuthPrimaryAuthenticationProvider being loaded and loading permission manager.

Right, that makes sense. I uploaded a patch to move confirmed user definition to the end of CS.php. I'll try to deploy it on Monday, and let's see if it works.

[...]

This is from the same series of bugs flagged revisions is suffering from - something somewhere changed and now PermissionManager/UserGroupManager are loaded earlier then extension functions are run. I think it might be CentralAuthPrimaryAuthenticationProvider being loaded and loading permission manager.

Right, that makes sense. I uploaded a patch to move confirmed user definition to the end of CS.php. I'll try to deploy it on Monday, and let's see if it works.

Actually...that will make the code run before extensions are inited, thus bringing T213003: Autoconfirmed rights set by extensions are out of sync with confirmed back. Meh... Unsure how to fix it config-only.

Yeah. Most likely. I don't think a config-only solution exist here. I'll try to get the fixes I mentioned in on Monday so that we could test soon. I don't think identifying and reverting the change that caused init sequence to shift earlier is possible at this point.

Yeah. Most likely. I don't think a config-only solution exist here. I'll try to get the fixes I mentioned in on Monday so that we could test soon.

Thanks a lot! Do let me know if I can help.

I don't think identifying and reverting the change that caused init sequence to shift earlier is possible at this point.

Indeed, I agree.

Change 665804 abandoned by Urbanecm:
[operations/mediawiki-config@master] Move confirmed group definition to the end of CS.php

Reason:

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

holger.knust lowered the priority of this task from High to Medium.Feb 23 2021, 2:41 PM
holger.knust moved this task from Inbox to Tracking/Watching on the Platform Engineering board.
holger.knust subscribed.

@Pchelolo are you working on this?

Urbanecm claimed this task.

Should be fixed.