What is the problem?
If I make multiple concurrent requests to the /wikimediaantiabuse/v0/[un]mark/revision/<revid>/<tag>/false-positive endpoint, I can make the ctd_count column incorrect in the change_tag_def table. For instance, I can see the count incremented twice even though only one revision has been newly tagged.
Steps to reproduce problem
- Install WikimediaAntiAbuse extension
- Add $wgWikimediaAntiAbuseEnablePersonalInfoTag = true; to your LocalSettings.php
- Find a revision on your local wiki and record its revision ID
- From the root of your wiki: php maintenance/run.php --wiki <wiki> applyChangeTag --tag mw-private-personal-info --revisions <revid>
- Connect to your local database and run: SELECT * FROM change_tag_def WHERE ctd_name LIKE "mw-private-personal-info%";
- Make a note of the ctd_count of mw-private-personal-info and mw-private-personal-info-false-positive rows (the latter may not exist yet)
- Download P95939 and save it as false_positive_concurrent.py
- On your local wiki, give two users (<user1> and <user2>) suppressor rights
- Run: python3 false_positive_concurrent.py --url <wiki url> -r <revid> --user1 <user1> --password1 <password> --user2 <user2> --password2 <password> (you may need to install python3-multiprocess)
- Run again: SELECT * FROM change_tag_def WHERE ctd_name LIKE "mw-private-personal-info%";
Expected behaviour: The ctd_count for the row mw-private-personal-info-false-positive should have been incremented once.
Observed behaviour: It is incremented twice.
If you run python3 false_positive_concurrent.py --url <wiki url> -r <revid> --user1 <user1> --password1 <password> --user2 <user2> --password2 <password> -t unmark you will see the row mw-private-personal-info incremented twice as well.
Environment
Wiki(s): local docker WikimediaAntiAbuse – (af8bf6a) 07:58, 6 August 2026.