Page MenuHomePhabricator

moveLogEntriesFromCuChanges import inconsistencies
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

When importing private events from cu_changes to cu_private_event, there are a few inconsistencies:

  • It imports the cuc_ip and cuc_ip_hex to the cuc_xff and cuc_xff_hex columns as well, even if the row in cu_changes had a blank cuc_xff.
  • When the log message is displayed in CheckUser, it is displayed as wikitext and not parsed as HTML (e.g. it will display Successfully logged in to enwiki as [[User:*Unregistered 223|*Unregistered 223]]).
Steps to reproduce problem
  1. In LocalSettings.php, save $wgCheckUserLogLogins = true;
  2. In LocalSettings.php, save $wgCheckUserEventTablesMigrationStage = SCHEMA_COMPAT_WRITE_OLD | SCHEMA_COMPAT_READ_OLD;
  3. Login to the wiki
  4. Replace the line you entered in step 2 with $wgCheckUserEventTablesMigrationStage = SCHEMA_COMPAT_WRITE_OLD | SCHEMA_COMPAT_WRITE_NEW | SCHEMA_COMPAT_READ_NEW;
  5. In the mediawiki core repo, run docker compose exec mediawiki php maintenance/run.php CheckUser:moveLogEntriesFromCuChanges.php --force
  6. Go to Special:CheckUser, enter the username of you user you logged in as in step 3, check "Get edits" and submit

Observed behavior: Latest entry will have a comment like Successfully logged in to enwiki as [[User:$user|$user]] and will have an XFF.

Environment

Wiki(s): local docker CheckUser 2.5 (f83dedb) 22:48, 27 September 2023.

QA Results - Local

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
ResolvedDreamy_Jazz
ResolvedBUG REPORTDreamy_Jazz

Event Timeline

Dreamy_Jazz subscribed.

Some silly mistakes occurred with the code here. Thanks for finding this.

Change 962122 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Fix MoveLogEntriesFromCuChanges maintenance script

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

Made this a blocker as the maintenance script should either be fixed for the 1.41 release or removed.

Change 962204 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Remove moveLogEntriesFromCuChanges.php from update.php

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

I've created https://gerrit.wikimedia.org/r/962204. Merging this patch is all that is needed to make this issue no longer a blocker for the 1.41 release.

Change 962204 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Remove moveLogEntriesFromCuChanges.php from update.php

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

Change 962122 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Fix MoveLogEntriesFromCuChanges maintenance script

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

Dreamy_Jazz updated the task description. (Show Details)
Dreamy_Jazz updated the task description. (Show Details)

@Dreamy_Jazz Special:Checkuser shows Successfully logged in to <wiki> as [[User:$user|$user]] as seen in the screenshots below. This will be moved to Done. Thanks for all your work!

Status: ✅PASS
Environment: Local: 1.42.0-alpha (c4af95b)15:06, 25 October 2023. CheckUser: 2.5 (1bca6c6) 19:16, 24 October 2023
OS: macOS Sonoma 14.0
Browser: Chrome 117, Firefox 118, Safari 17.0
Skins. Vector 2022, 2010, Minerva, Monobook, Timeless
Device: MBA M2
Emulated Device:: n/a
Test Links:
http://localhost:8080/wiki/Special:CheckUser

✅AC1: https://phabricator.wikimedia.org/T347669

No XFFXFFSafariFirefoxTimeless (All skins the same)
2023-10-25_08-37-03.png (1×3 px, 330 KB)
2023-10-25_15-28-30.png (1×3 px, 362 KB)
2023-10-26_13-38-40.png (1×2 px, 291 KB)
2023-10-26_13-41-33.png (1×2 px, 312 KB)
2023-10-26_13-44-27.png (1×2 px, 315 KB)