Page MenuHomePhabricator

Avoid double-processing of abuse filter actions
Closed, ResolvedPublic

Description

After the resolution of T189827, I noticed that you can't filter logs for action taken = block. This is only true for new blocks (with custom duration), when the log says "Action taken: block, block" and thus are different from "action taken: block". If no-one does, I'll work on it as soon as I'll finish what I'm currently working to, but I would also like to know whether we should backport this.

Details

Related Gerrit Patches:
mediawiki/extensions/AbuseFilter : wmf/1.31.0-wmf.25Avoid double processing block actions
mediawiki/extensions/AbuseFilter : masterAvoid double processing block actions

Event Timeline

Daimona created this task.Mar 16 2018, 7:22 AM
Restricted Application added subscribers: Scoopfinder, Aklapper. · View Herald TranscriptMar 16 2018, 7:22 AM
Daimona triaged this task as High priority.Mar 16 2018, 7:22 AM
Daimona moved this task from Backlog to Internal bugs on the AbuseFilter board.

Change 419988 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Avoid double processing block actions

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

Daimona claimed this task.Mar 16 2018, 9:04 AM

It was another stupid mistake, easy to fix. I still wonder if we should backport this. In any case, every action processed before this fix is released will show "block, block" forever and won't be filtered.

Change 420028 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@wmf/1.31.0-wmf.25] Avoid double processing block actions

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

Huji added a subscriber: Huji.Mar 16 2018, 1:49 PM

@Daimona I created a catch-all filter (condition: 1==1) with these blocking options:

Then I made an edit and the account was blocked. In the logs, when I filtered "Action taken" to "block", the log entry for today's block was not there. So the issue you raised does exist.

Then I applied your patch, and redid all of the above. Again, when I filtered "Action taken" to "block", the log entry for today's block was not there. So the issue you raised is not completely resolved by the patch.

Then I looked at the database:

mysql> select afl_id, afl_user, afl_title, afl_action, afl_actions from abuse_filter_log where afl_id > 51;
+--------+----------+-----------+------------+-----------------+
| afl_id | afl_user | afl_title | afl_action | afl_actions     |
+--------+----------+-----------+------------+-----------------+
|     52 |        3 | BlockMe   | edit       | block,tag,block |
|     53 |        3 | BlockMe   | edit       | tag,block       |
+--------+----------+-----------+------------+-----------------+
2 rows in set (0.00 sec)

So your patch is fixed the double processing of block action, but it is not resolving the issue of that entry not being shown on the abuse log. I am going to +2 your patch, because double processing of actions is a bad idea. But the issue with abuse log search is beyond what your patch addresses, and needs to be addressed through T187971.

@Huji Strange, I also tested my patch in local and it did work: block was processed only once and it was filtered in AbuseLog. However, old entries catched with "block, block" won't be fixed, and they still won't appear when filtering AbuseLog. This is why I decided to also backport the fix, which should be merged soon. Whether we want to also fix and/or recognize such duplicated actions, it's a separate matter.

Huji added a comment.Mar 16 2018, 2:32 PM

Your patch fixes the "double-processing" issue; but the original issue raised in this task was "When filtering logs for action taken, 'block' isn't showed" and that is not just due to the double processing of block action; it also has to do with another issue that I just explained in T187971.

@Huji, right, I read it. However I'm still surprised because, as said above, on my local wiki after this patch I'm again able to filter "block" actions.

Huji added a comment.Mar 16 2018, 2:37 PM

Most likely because on your wiki, the only actions enforced by your filters are "block" and "block,tag".

Try creating a filter that does several actions, like block and range block and tag; then trigger it; then go to abuse log and use the "block" filter and see what happens.

Oh, right, confirmed. The filter I used to test only had "block" activated.

Change 419988 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Avoid double processing block actions

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

Huji closed this task as Resolved.Mar 16 2018, 2:59 PM
Huji removed a project: Patch-For-Review.

Marking this as resolved, and renaming it shortly.

Huji renamed this task from When filtering logs for action taken, "block" isn't showed to Avoid double-processing of abuse filter actions.Mar 16 2018, 2:59 PM

Change 420028 abandoned by Daimona Eaytoy:
Avoid double processing block actions

Reason:
No longer needed.

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