Page MenuHomePhabricator

What should happen if clicking on an IP reveal button results in an API error?
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

The buttons were added in T326415: Add (show IP) buttons next to temporary account user name links.

In theory, clicking on a button should make a successful API call and reveal the returned IP address (unless the IP address was purged due to elapsed time, in which case it reveals "unavailable").

However, the API call may result in an error. The software should prevent most of these errors from occurring; they would usually indicate a bug.

Possible error messages include:

  • "You do not have permission to perform the action" - in which case the button should not have been shown
  • "You do not have permission to perform the action because your account is blocked" - in which case the button should not have been shown
  • "The specified username ($1) is invalid" - which indicates a bug in building the request URL
  • Various bad parameter messages - which indicate a bug in building the request URL
  • Too many revisions were sent in the API request - not a software bug; user was on a long page
Question

What should be displayed if an error is encountered, if anything?

Event Timeline

Thanks for describing the possible error messages @Tchanders. I think for the first four which would happen because of bugs (or cases when things changed after the page has loaded, user got blocked etc) we could just show 'error' how we show 'unavailable'.

Too many revisions were sent in the API request - not a software bug; user was on a long page

I think for this one (and others like it if there are any) we should tell the user what is happening. Preferably in a dialog (OOUI/Codex) if we have that available, or at least in the text.

Change 924969 had a related patch set uploaded (by TsepoThoabala; author: TsepoThoabala):

[mediawiki/extensions/CheckUser@master] Show error message when clicking on an IP reveal button results in an API error

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

AGueyte set the point value for this task to 2.May 31 2023, 4:44 PM

Change 924969 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Show error message when clicking on an IP reveal button results in an API error

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

@TThoabala Do we need to do this for Show IP on Special:Block? Should I create a separate task?

@dom_walden I think we should create a separate task for that.

@Tchanders should we create a ticket for Too many revisions were sent in the API request - not a software bug; user was on a long page?

@TThoabala So the first two seem to be working as designed since they do not display ShowIP.

"The specified username ($1) is invalid" - which indicates a bug in building the request UR- when the username is deleted, it just shows "username removed". Is that fine for that?

Various bad parameter messages - which indicate a bug in building the request URL- IP was deleted from the DB but it still shows "unavailable" besides "error"

The last two are different errors that I came across in Special:Block. Please let me know if you want separate tasks for them or however, you want me to proceed. Thanks!

OS: macOS 13.3
Browser: Chrome 113
Environment: Local

Testing IP reveal on:

  • Revision history
  • Special:Contributions
  • Special:Log
  • Special:Block
  • Special:RecentChanges
  • Special:Watchlist
  • Diff
  • Page information

You do not have permission to perform the action- WAD; Removed checkuser-temporary-account

T333190_IPMasking_IPReveal_Permission.png (671×3 px, 325 KB)

"You do not have permission to perform the action because your account is blocked- WAD; Blocked Testusertwo

T333190_IPMasking_IPReveal_Block.png (540×3 px, 240 KB)

The specified username ($1) is invalid- WAD?; Deleted *Unregistered 31

T333190_IPMasking_IPReveal_Invalid.png (549×3 px, 238 KB)

Various bad parameter messages -WAD?; IP removed from the DB

T333190_IPMasking_IPReveal_IPDeleted.png (869×1 px, 349 KB)

Different Special:Block Errors
On the username invalid screenshot, I deleted *Unregistered 31. When I was checking out various pages to see if it has the same outcome, it has except on Special:Block. All the other pages it shows deleted but on Special:Block it still shows the IP address of the deleted user

T333190_IPMasking_IPReveal_DeletedSpecialBlock.png (315×3 px, 121 KB)

Also on Special:Block when you do a partial with a selected page like in the example I used for "Dog". Show IP did not show up on all the other pages too when it was supposed to be just on the "Dog" page.

T333190_IPMasking_IPReveal_PartialDeletedSpecialBlock.png (1×3 px, 218 KB)

T333190_IPMasking_IPReveal_PartialDeletedSpecialBlock2.png (484×3 px, 197 KB)

Thanks at @GMikesell-WMF, I think all other bits look good besides the special block stuff. Some of these will be covered by the ticket @dom_walden created, but could we please create another ticket for partial block use case above.