Page MenuHomePhabricator

Update ArticleFeedbackv5 rebuildCheckUser.php maintenance script for CheckUser extension database changes
Open, Needs TriagePublic

Description

Following T324907: Create separate tables for log events in CheckUser, the CheckUser extension now has the cu_log_event and cu_private_event tables that contain CheckUser data. These tables hold log event data and cu_changes from MediaWiki 1.43 will no longer have rows for log events.

The rebuildCheckUser.php maintenance script modifies rows in the cu_changes table that will no longer be in this table. Instead, new rows will be in the cu_log_event table and rows that were in the cu_changes table have been moved to the cu_private_event table. As such, this script should either be removed as no longer necessary or updated to fix rows in the cu_private_event table (as I assume that new rows are already fixed so don't need this maintenance script).

Event Timeline

Thanks for filing this task! 👍

The script in question was added in e2ae180da5e8b7431c7fa537446566261bbe085f almost 12 years ago. Sadly the commit message doesn't provide much further context; grep shows only one match for "CheckUser" outside that file (in includes/ArticleFeedbackv5LogFormatter.php, in the docblock for the getActionText method, also added in the same commit).

Now, I'm not familiar with either the latest CheckUser changes (all I know is that there's a lot of 'em!) nor with AFTv5's...support for CheckUser, if you can call it that. I mean, is there even any kind of support since it doesn't seem that AFTv5 does anything special, but should it? MediaWikiChat at least calls MediaWiki\CheckUser\Hooks::updateCheckUserData in its /includes/api/ChatSendAPI.php file, because otherwise CheckUser probably doesn't know that a chat message was sent; I'm inclined to think that the same might be true for AFTv5, that CheckUser can't "see" that the user submitted feedback/actioned on a submitted feedback post/whatever unless the extension deliberately pings CheckUser to let CU know "hey, something happened, let's log it".

It appears to me as if this script was intended to fix bad entries in the cu_changes table, specifically:

  • fix log entry usernames: anon actions have at times been identified as "Article Feedback V5" rather than as IP
  • fix bad action texts for AFT: the native formatter getPlainActionText did not support AFT entries too well, leaving it packed with escaped html entities, causing a horrible display

My feeling is that the fixes performed by the script have likely been applied and that the problems that caused these issues should have been fixed when the script was added. As such, I think it should be safe to remove the script.

Noting that further changes are being made to drop the cuc_ip column. I think the script likely can be dropped to address this task