Page MenuHomePhabricator

IP Masking: Refresh brings it back to Show IP even when $wgCheckUserTemporaryAccountMaxAge is configured Locally
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT


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

  • Create a temp user on any page Locally
  • Configure wgCheckUserTemporaryAccountMaxAge in seconds ex. 200
  • Go to Diff, Recent Changes, Page Info, Watchlist, etc.
  • Click on the Show IP to reveal IP address
  • Click the Refresh on your Browser

What happens?:
Show IP button reappears on you click the Refresh button on your browser beside the revealed IP from the time you configured as seen in the screenshot below.

What should have happened instead?:
After that time has elapsed, the buttons should reappear, instead of the revealed IPs

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

T333367_IPMasking_ShowIP_AccountMaxAge_Diff.png (947×3 px, 601 KB)

Event Timeline

GMikesell-WMF renamed this task from Refresh brings it back to Show IP even when $wgCheckUserTemporaryAccountMaxAge is configured Locally to IP Masking: Refresh brings it back to Show IP even when $wgCheckUserTemporaryAccountMaxAge is configured Locally.May 9 2023, 8:28 PM

This bug seems to have been introduced sometime since the commit that solved T333367 - a9d5d9642eca38869d68db846c665ae58ab20b3b. Rolling back to that commit, the bug doesn't occur.

@Tchanders, am not sure if this is related, but noticed two files were deleted by this patch: Could this be the one causing the issue? Or was the code transferred to another file?

What I am seeing is that the pages that are not SpecialContributions do save when the accounts have been revealed but do not check on load whether they have been revealed and therefore do not proceed with revealing those IPs.

On SpecialContributions.js we can see:

// If the user has been revealed lately, reveal it on load
if ( ipRevealUtils.getRevealedStatus( mw.config.get( 'wgRelevantUserName' ) ) ) {
	$( document ).trigger( 'userRevealed', mw.config.get( 'wgRelevantUserName' ) );
$( document ).on( 'userRevealed', function () {
	var $relevantUserLinks = $ function ( _i, el ) {
		return $( el ).find( '.ext-checkuser-tempaccount-reveal-ip-button' );
	} );

	// Synthetically trigger a reveal event
	$relevantUserLinks.each( function () {
		$( this ).trigger( 'revealIp' );
	} );
} );

And this file is called from the Dispatcher.js only in the case of visiting a Special:Contribution page

	case 'Contributions':
			if ( mw.config.get( 'wgRelevantUserName' ) &&
				mw.util.isTemporaryUser( mw.config.get( 'wgRelevantUserName' ) ) ) {
				require( './temporaryaccount/SpecialContributions.js' );

The other pages such as "Diff, Recent Changes, Page Info, Watchlist, etc" as mentioned in the ticket, only access Dispatcher.js, initOnHook.js, and then IPReveal.js

Those files do not proceed with finding out whether the IPs from the page that is being loaded have been revealed etc.
And to second @GMikesell-WMF on T333367, doesn't matter what I set on $wgCheckUserTemporaryAccountMaxAge locally.

Going back on previous patches prior to T333367, I do not get any IP reveal persist.
I do see the right information stored in localStorage but the reveal would only happen on Special:Contribution.php

Screenshot 2023-05-30 at 12.27.09 PM.png (1×2 px, 294 KB)

Screenshot 2023-05-30 at 12.27.15 PM.png (1×2 px, 491 KB)

It feels now the problem with persist reveal is a lot bigger than just using $wgCheckUserTemporaryAccountMaxAge.
This ticket should re-focus on insuring the IP reveal persist across the pages.

AGueyte set the point value for this task to 3.
AGueyte added a subscriber: Cyndymediawiksim.

Change 924992 had a related patch set uploaded (by AGueyte; author: AGueyte):

[mediawiki/extensions/CheckUser@master] Fix IP reveal persit on all pages

Change 924992 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Fix IP reveal persit on all pages

@AGueyte It seems to be good for the most part but I did come across not showing up with Special:Block as seen in the .webm below. If I start there or end there while setting it for 60 seconds or whatever, it will have Show IP no matter what.

OS: macOS 13.3
Browsers: Chrome 113, Firefox 113, Safari 16.4
Skins: Vector 2022, 2010, Minerva, Monobook, Timeless

Sites tested on for 30 and 60 seconds

  • Special:Contributions
  • Special:Block
  • Special:RecentChanges
  • Special:Watchlist
  • Diff
  • Page information

@AGueyte I also created a separate ticket for T338154: IP Masking: Special:Block- ShowIP appears when "*" only has been entered, regarding ShowIP appearing once "*" has been entered in Special:Block. Thanks!