Page MenuHomePhabricator

"(no username available)" shown twice for hidden revisions
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

If a revision has its editor hidden, the entry in Special:GlobalContributions will show:

(no username available) ((no username available))
Steps to reproduce problem
  1. Go to Special:GlobalContributions/<ip> for an <ip> you know has temporary account edits on the current wiki
  2. On one of the entries, click "(change visibility)"
  3. Check "Editor's username/IP address" and submit
  4. Refresh Special:GlobalContributions/<ip>

Expected behaviour: The entry you just hid has only one "(no username available)".
Observed behaviour: "(no username available)" is shown twice.

Environment

Wiki(s): local docker CheckUser 2.5 (f4155ae) 17:43, 13 November 2024.

Screenshots

no_username_available.png (52×1 px, 25 KB)

Event Timeline

Tchanders subscribed.

From memory, this may be an upstream bug with Special:Contributions. We should look into that, however, because I may be wrong.

Change #1145908 had a related patch set uploaded (by Harroyo-wmf; author: Harroyo-wmf):

[mediawiki/extensions/CheckUser@master] globalcontributions: Don't show "no username available" twice in log entries

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

Change #1145909 had a related patch set uploaded (by Harroyo-wmf; author: Harroyo-wmf):

[mediawiki/core@master] contributions: Don't show "no username available" twice in log entries

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

Change #1145908 merged by Dreamy Jazz:

[mediawiki/extensions/CheckUser@master] globalcontributions: Don't show "no username available" twice in log entries

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

Change #1146024 had a related patch set uploaded (by Harroyo-wmf; author: Harroyo-wmf):

[mediawiki/extensions/CheckUser@master] globalcontributions: Move formatUserLink() logic into a formatter service

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

I've submitted two additional patches to clean up the code a little bit and update unit tests that are now ready for review:

The two additional patches introduce technical changes but, from a functional point of view, this was fixed in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CheckUser/+/1145908, which was merged two weeks ago. Since the fix was already merged, I'm setting the new patches as Drafts so the fix itself can be moved to QA on its own.

Djackson-ctr subscribed.

The new code changes have been verified and are functioning as expected (Special:GlobalContributions/<ip>: The entry that's hidden shows '(no username available)' only once instead of twice).

image.png (127×1 px, 13 KB)

Change #1146024 abandoned by Harroyo-wmf:

[mediawiki/extensions/CheckUser@master] globalcontributions: Move formatUserLink() into a formatter service

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

Change #1145909 abandoned by Harroyo-wmf:

[mediawiki/core@master] contributions: Move formatUserLink() logic into a formatter service

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