Page MenuHomePhabricator

Automoderator should not display an internal IP address in the edit summary
Closed, ResolvedPublic

Description

On test.wiki Automoderator is displaying an internal IP address in the edit summary, when reverting my anonymous edits:

https://test.wikipedia.org/w/index.php?title=13_%C5%9Eubat&action=history

Screenshot 2024-05-24 at 14.07.53.png (184×2 px, 126 KB)

The edit summary should contain the IP address displayed for the user in the page history, not an internal one.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

A manual undo finds the correct address to use:

image.png (424×2 px, 226 KB)

Reverting a user also displays this internal IP, instead of the username:

image.png (352×1 px, 175 KB)

jsn.sherman changed the task status from Open to In Progress.May 24 2024, 1:27 PM
jsn.sherman claimed this task.
jsn.sherman triaged this task as High priority.
jsn.sherman moved this task from Ready to In Progress on the Moderator-Tools-Team (Kanban) board.

locally, the user param from the mysql queue can be treated directly like a userIdentity. in beta, we get a serialized json representation of that object so we get the user from the global request context. In the production jobrunner, one of those two sources (the job param or the request context user) is set to this internal ip address rather than the user who initiated the original request. We set the job params in our hook implementation, so I'm going to set it to change it to the uid which should let us avoid any of these serialization/request context complications. It will add a db lookup to the job, but those are running async so it should not be an issue.

Change #1035803 had a related patch set uploaded (by Jsn.sherman; author: Jsn.sherman):

[mediawiki/extensions/AutoModerator@master] [WIP] use correct username in edit summary

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

Change #1035803 merged by jenkins-bot:

[mediawiki/extensions/AutoModerator@master] use correct username in edit summary

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