Page MenuHomePhabricator

Execute actions after having actually determined which actions to execute
Closed, ResolvedPublic

Description

Right now, this is how actions are taken:

  1. Filters are executed (in checkAllFilters) and actions are collected
  2. executeFilterActions iterates through the array of collected actions and executes them (with the help of takeConsequenceAction)

In point 2, we perform some checks on the fly (e.g. if we already warned the user, to avoid double warnings etc) and, most important, we don't know what actions will have been executed in the end. So, for instance, if we just warn the user, we end up counting that for throttle (T24623). For this reason, when implementing blocks with variable durations, I had to move the logic for blocking at the end of executeFilterActions in order to use the longest duration.
Instead, we could save time and have a clearer (and more customizable) code by:

  1. Collecting actions (point 1 above)
  2. Filtering such array of actions, only picking the ones with highest priority to later execute, avoiding duplicated warnings etc.
  3. Only execute actions from point 2 without further checks

Event Timeline

Change 462931 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Filter out actions to execute before actually executing them

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

Change 462931 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Filter out actions to execute before actually executing them

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

Change 462931 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Filter out actions to execute before actually executing them

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

Daimona removed a project: Patch-For-Review.

Done?

I'd say: yes! Thank you.