Page MenuHomePhabricator

"Show IP" button doesn't appear next to a temporary user when viewing a diff using "diff=prev", "diff=cur" or "diff=next"
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Assigned To
Authored By
Dreamy_Jazz
Mar 2 2023, 1:18 PM
Referenced Files
F36911367: oldid_showip.png
Mar 14 2023, 5:13 PM
F36888427: image.png
Mar 2 2023, 1:18 PM
F36888425: image.png
Mar 2 2023, 1:18 PM
F36888420: image.png
Mar 2 2023, 1:18 PM
F36888418: image.png
Mar 2 2023, 1:18 PM
F36888416: image.png
Mar 2 2023, 1:18 PM
F36888414: image.png
Mar 2 2023, 1:18 PM

Description

Steps to replicate the issue (include links if applicable):

  • Make a edit with a temporary account
  • Log into an account that can view temporary account IPs and has the preference enabled
  • Load the history page and find the edit - observe that the "Show IP" link is shown
  • Click "prev" to load the diff for said edit

What happens?:
Observe that the "Show IP" button is not shown.

What should have happened instead?:
The "Show IP" button should be shown.

Software version (skip for WMF-hosted wikis like Wikipedia):
Latest CheckUser and core

Other information (browser name/version, screenshots, etc.):

Diff typeURL used to show diffUsername of temporary account
Diff as the revision ID
image.png (54×490 px, 6 KB)
image.png (60×581 px, 9 KB)
Link generated by the "prev" link
image.png (63×803 px, 10 KB)
image.png (80×492 px, 11 KB)
Difference between two specified revisions
image.png (58×753 px, 9 KB)
image.png (125×1 px, 36 KB)

This is likely caused by the PageDisplay hook handler checking checking only whether the diff query parameter is an integer. Because the diff parameter is prev in the second set of screenshots, it means it's not seen as a valid diff page.

Event Timeline

Dreamy_Jazz renamed this task from "Show IP" button doesn't appear for temporary user when viewing a diff not through Special:Diff to "Show IP" button doesn't appear for temporary user when viewing a diff using "diff=prev" or "diff=next".Mar 2 2023, 1:19 PM
Dreamy_Jazz renamed this task from "Show IP" button doesn't appear for temporary user when viewing a diff using "diff=prev" or "diff=next" to "Show IP" button doesn't appear next to a temporary user when viewing a diff using "diff=prev" or "diff=next".EditedMar 2 2023, 1:23 PM

This will likely just involve checking to see if the diff parameter is set as if the string value is not accepted the latest diff is shown instead.

Dreamy_Jazz renamed this task from "Show IP" button doesn't appear next to a temporary user when viewing a diff using "diff=prev" or "diff=next" to "Show IP" button doesn't appear next to a temporary user when viewing a diff using "diff=prev", "diff=cur" or "diff=next".Mar 2 2023, 1:33 PM

Change 894710 had a related patch set uploaded (by JayCano; author: JayCano):

[mediawiki/extensions/CheckUser@master] WIP: Display "Show IP" buttons when using diff keywords

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

Tchanders set the point value for this task to 2.Mar 8 2023, 12:43 PM

Change 894710 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Display "Show IP" buttons when using diff keywords

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

Hopefully the testing process is clear from the task description, but let me know if not.

In case it's of interest, I tested as in the task description, and also modified the diff param in the URL directly to test the keywords (prev, cur, next), an int ID, an invalid string and empty string (since those generate a diff page too).

dom_walden added subscribers: Niharika, dom_walden.

I tried various different combinations of diff and oldid and saw that the temporary username always had a "Show IP" link next to it.

I did notice that when viewing an old revision using only the oldid parameter the temporary user that is displayed did not have the link (see below). I don't know if we wanted it to. I haven't found a phab ticket for this. Should I raise a separate one? @Tchanders @Niharika?

oldid_showip.png (323×611 px, 35 KB)

(Example from dewiki beta: https://de.wikipedia.beta.wmflabs.org/w/index.php?title=Benutzer:*Unregistered_2798&oldid=30829)

Python code to generate combinations:

combs = [964, 984, "next", "prev", "curr", "", False]
for comb in list(itertools.product(combs, combs)):
    "http://localhost:8080/w/index.php?title=Main_Page{}{}".format("&diff={}".format(comb[0]) if comb[0] != False else "", "&oldid={}".format(comb[1]) if comb[1] != False else "")

Test environment: Local docker CheckUser 2.5 (0b5ffbd) 07:38, 13 March 2023.

There is a task for this which is T331008 which should cover it not being shown if oldid is present.

Thanks @Dreamy_Jazz. @dom_walden would T331008 cover it?

Yep. I didn't see that, thanks!