A newcomer reported that Special:Impact wasn't returning any results for them at French Wikipedia.
I checked various wikis where the new impact module is deployed:
- not returning numbers: French, Czech
- working at designed: Spanish, French Wiktionary
A newcomer reported that Special:Impact wasn't returning any results for them at French Wikipedia.
I checked various wikis where the new impact module is deployed:
This is a regression from T338640: Impact Module: New editors who have edited outside of the main namespace should see the Impact module empty state. The issue is in UserDatabaseHelper::hasMainspaceEdits, which is supposed to "return null if the user's first $limit edits are all not in the main namespace", but it actually returns null if all first 1000 of user edits are in the main namespace.
For the code to be correct, it needs to fetch up to first 1000 edits and check (on the application level) whether there are any in the main namespace. If so, it should return "Yes, this user has edited in the main namespace". Otherwise, it needs to return "No edits in the main namespace" or "Not sure" depending on whether the user has more than 1000 edits.
Patch incoming. Tests should be added for UserDatabaseHelper in this task as well (to avoid similar issues re-happening), but I'll submit them in a different patch, to not block the fix.
Change 938880 had a related patch set uploaded (by Urbanecm; author: Urbanecm):
[mediawiki/extensions/GrowthExperiments@master] Fix UserDatabaseHelper::hasMainspaceEdits
Change 938884 had a related patch set uploaded (by Urbanecm; author: Urbanecm):
[mediawiki/extensions/GrowthExperiments@master] [tests] Add UserDatabaseHelperTest
Change 938880 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] Fix UserDatabaseHelper::hasMainspaceEdits
Change 938680 had a related patch set uploaded (by Urbanecm; author: Urbanecm):
[mediawiki/extensions/GrowthExperiments@wmf/1.41.0-wmf.17] Fix UserDatabaseHelper::hasMainspaceEdits
Change 938680 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@wmf/1.41.0-wmf.17] Fix UserDatabaseHelper::hasMainspaceEdits
Mentioned in SAL (#wikimedia-operations) [2023-07-17T16:33:13Z] <urbanecm@deploy1002> Started scap: Backport for [[gerrit:938680|Fix UserDatabaseHelper::hasMainspaceEdits (T341994)]]
Mentioned in SAL (#wikimedia-operations) [2023-07-17T16:34:40Z] <urbanecm@deploy1002> urbanecm: Backport for [[gerrit:938680|Fix UserDatabaseHelper::hasMainspaceEdits (T341994)]] synced to the testservers mwdebug2002.codfw.wmnet, mwdebug1001.eqiad.wmnet, mwdebug1002.eqiad.wmnet, mwdebug2001.codfw.wmnet, and mw-debug kubernetes deployment (accessible via k8s-experimental XWD option)
Mentioned in SAL (#wikimedia-operations) [2023-07-17T16:41:56Z] <urbanecm@deploy1002> Finished scap: Backport for [[gerrit:938680|Fix UserDatabaseHelper::hasMainspaceEdits (T341994)]] (duration: 08m 43s)
Should be fixed on production now.
@Etonkovidova FYI: This bug affected users with more than 1000 of main namespace edits only, so this might be trickier to test.
Thanks, @Urbanecm_WMF! Checked on production via Special:Impact. I checked on both frwiki and cswiki for users with >1000 edits and >10,000 edits. the Impact module looks as expected. Also, non-mainspace edits are filtered out from the total count of edits.
Change 938884 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] [tests] Add UserDatabaseHelperTest