If an user (whose username is "A", for instance) triggers one of the abuse filters on a mediawiki-based site when editing, the edit will be logged at /Special:Abuselog?wpSearchUser=A . However, if A is renamed to B, /Special:Abuselog?wpSearchUser=B no longer lists his edits that was done before renaming and triggered filters. This is definitely not expected. Actually, other kinds of logged actions (deletion log, block log, etc) will be moved under the new username after a successful user renaming.
1 [[https://commons.wikimedia.org/wiki/File:Af_bug_beforename.png|A user named "Antigng-test" triggered the filter]]
2 [[https://commons.wikimedia.org/wiki/File:Af_bug_successfulrename.png|"Antigng-test" was renamed to "Antigng-test1"]]
3 [[https://commons.wikimedia.org/wiki/File:Af_bug_afterrename.png|The logged action is not moved under the new username "Antigng-test1"]]
(mediawiki 1.30.0)
This is because [[https://github.com/wikimedia/mediawiki-extensions-AbuseFilter/blob/master/includes/special/SpecialAbuseLog.php#L272|the showlist() function uses both "afl_user" and "afl_user_text" as query conditions.]] Before the user's renaming, parameters for both "afl_user" and "afl_user_text" refer to the same user. The renaming process, however, changes "user_name" in the user table while leaves the abuse_filter_log table unchanged. Thus edits triggered the filter before the renaming is not visible from Special:Abuselog .
In order to fix this problem, we should either use "afl_user" in queries , or change the abuse_filter_log table during the renaming.