InternationalScratchWiki / scratch-confirmaccount-v3

A new in-house account request system for the Scratch Wikis.
4 stars 6 forks source link

User count not incremented on account creation #197

Closed Mrcomputer1 closed 2 months ago

Mrcomputer1 commented 3 months ago

User:Purin2022 noticed (here and here) that the {{NUMBEROFUSERS}} magic word reports that there are 2379 registered users, while Special:ListUsers lists 3682+ users, which is over 1000 additional users.

The {{NUMBEROFUSERS}} (and also the Special:Statistics special page) retrieves the user count from the site_stats table's ss_users field. In MediaWiki's AuthManager, after creating the user, this stat is incremented here with this code:

// Update user count
DeferredUpdates::addUpdate( SiteStatsUpdate::factory( [ 'users' => 1 ] ) );

When creating an account, Scratch ConfirmAccount does not increment that stat, leading to the stat drifting away from the true user count.

Fixing this should be as simple as adding that line to increment the stat to createAccount in DatabaseInteractions.php (I can create a PR to do this if wanted). To fix the statistic on the wikis themselves, the initSiteStats.php maintenance script with the --update parameter could be used to update the user count.


Something kind of interesting: The user count is stopped at 2379, which is close to the user id for User:Abuse filter (2381). User:Abuse filter doesn't seem to have any user creation log entry. However, looking at the creation date of the user created before (08:12, 30 September 2020 AEST) and after (05:42, 1 October 2020 AEST), in between these two times is 30/09/2020 11:04 AEST, which is the time jvvg sent an announcement in #announcements about the wiki being down for the MediaWiki 1.35 upgrade. So, this seems to suggest that the user count has been frozen for nearly four years, ever since the MW 1.35 upgrade.

jacob-g commented 3 months ago

We created this version of the extension for the 1.35 upgrade, which explains your observations.

This isn't a super high priority issue, but is a pretty simple thing to fix so might as well get it done as time permits.