Page MenuHomePhabricator

Error in popup when trying to view info for IPv6 edits in Recent Changes enhanced view
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Description

What is the problem?

When viewing edits from IPv6 addresses in Recent Changes with enhanced view enabled, it returns an error:

The IP address provided did not match the log or revision.

This is because it displays IPv6 addresses slightly differently. In most places they are shown like 2001:678:a08::, but here they are shown like 2001:678:A08:0:0:0:0:0. So, when we check whether the IP address matches what is returned by the API, it does not count as a match.

The IP needs to be normalised before comparison. Since T301174: Create IP utilities for sanitizing and prettifying IPs via js, we are now able to do this.

It only seems to affect Recent Change entries for edits, and only if you have the enhanced mode on. Log entries work, as they show IPv6 addresses like the former.

Steps to reproduce problem
  1. Make an edit from an IPv6 address (if your personal IP address is not IPv6, you can use a VPN or this script, doc here)
  2. Go to Special:Preferences, open the "Recent Changes" tab and make sure Group changes by page in recent changes and watchlist is checked.
  3. Go to Special:RecentChanges
  4. Click on the (i) button for the edit you made in step 1

Expected behavior: You should see the IP information
Observed behavior: You see an error

Environment

Wiki(s): Local docker IP Info 0.0.0 (41a1e35) 07:12, 17 January 2022.

Screenshot

ipv6_rc_enhanced.png (159×640 px, 39 KB)

Event Timeline

STran set the point value for this task to 1.Feb 7 2022, 5:32 PM

Change 773294 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/IPInfo@master] Use prettified IPs in popup when comparing API response to UI

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

Change 773294 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Use prettified IPs in popup when comparing API response to UI

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

I cannot reproduce this on my local docker, for a variety of IPv6 addresses, including those of the form 2001:678:A08:0:0:0:0:0 (which were causing us the problem in the first place).

On testwiki, I tested a variety of IPv6 and IPv4 addresses on revision history, Special:Log and Special:RecentChanges (enhanced and not enhanced) on Safari 14.

I did the same on Firefox for different skins in Arabic (in case RTL matters).

One thing to note is that on testwiki I don't have much control of the IPs that are available. There can be quite a variety of IPv6 addresses and I am not sure I covered them all (e.g. those that end in ::, those that contain :: but not at the end, those that contain :0:, etc.) However, between testwiki and my local docker I think I have fairly high coverage.

Test environments:

  • https://test.wikipedia.org IP Info 0.0.0 (a37fa42) 17:03, 28 March 2022.
  • local docker IP Info 0.0.0 (a37fa42) 17:03, 28 March 2022

Test browsers: Firefox 91, Safari 14.