Some of the external variables in AbuseFilter (at least user_mobile and user_app, maybe more) are correctly computed while the edit is being saved, so filters using them work as intended. However, they aren't computed for edits in RC. To see it, head on any wiki, find an edit performed via mobile site/app (e.g. searching on Special:Tags), examine it in AbuseFilter and check for the values of user_app/user_mobile: you'll see that such variables are false.
This happens because in getVarsFromRCRow (and sub-methods) we use generateUserVars to compute such variables, which in turn runs the AbuseFilter-generateUserVars hook, used by other extensions. However, the method used by such extensions to determine the variable value is not suitable for RC edits, and thus fails. We should make the change there, but I'm wondering how. Maybe read the change tags?
Description
Details
Related Objects
- Duplicates Merged Here
- T245916: user_mobile variable is not working in Abusefilter testing tool
Event Timeline
Change 456402 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Add a parameter to generate(User|Title)Vars hooks to specify context
Change 456408 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/MobileFrontend@master] Update AbuseFilter hook for user_mobile variable
Change 456409 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/MobileApp@master] Update AbuseFilter hook for user_app variable
Change 456415 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/WikimediaEvents@master] Update AbuseFilter hook for user_wpzero variable
Change 456402 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Add a parameter to generate(User|Title)Vars hooks to specify context
Change 456402 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Add a parameter to generate(User|Title)Vars hooks to specify context
Change 456415 abandoned by Daimona Eaytoy:
Update AbuseFilter hook for user_wpzero variable
Reason:
This code was killed
This patch (7 months ago) added a public lookup method for change tags. This is exactly what we needed to move on.
Change 456408 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/MobileFrontend@master] Update AbuseFilter hook for user_mobile variable
Change 456409 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/MobileApp@master] Update AbuseFilter hook for user_app variable
This requires a change to MobileFrontend, however review of that change is currently blocked on change to core. @Reedy as the last person who touched includes/logging/RCDatabaseLogEntry.php do you know which team maintains that part of the code and could help with review?
Please re-add "Web-Team-Backlog" when a review is needed for the MobileFrontend part of this change.
Change 456408 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Update AbuseFilter hook for user_mobile variable
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/ /456408
Change 456409 merged by jenkins-bot:
[mediawiki/extensions/MobileApp@master] Update AbuseFilter hook for user_app variable