Page MenuHomePhabricator

Sort results by cuc_ip_hex in Special:Investigate
Closed, ResolvedPublic

Description

In the 'IPs and User agents' tab, the results are grouped and sorted by cuc_user_text, cuc_ip, cuc_agent. The use of cuc_ip leads to incorrect sorting:

sorting_init_ipv4.png (268×340 px, 13 KB)

We should instead use cuc_ip_hex.

Event Timeline

Change 605318 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/extensions/CheckUser@master] Sort Special:Investigate results by cuc_ip_hex instead of cuc_ip

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

I generally try to stay away from CU 2.0 tasks but I want to point out that some of the development on it, including this task, may conflict with T233004

Tchanders added subscribers: dmaza, dbarratt.

Thanks @Huji, that's helpful to know.

@dmaza @dbarratt I don't think T233004 should affect this task, but we might need to update our queries at some point, including the one that this task touches.

Change 605318 merged by jenkins-bot:
[mediawiki/extensions/CheckUser@master] Sort Special:Investigate results by cuc_ip_hex instead of cuc_ip

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

dom_walden subscribed.

I created some test data on my local vagrant (MediaWiki 1.35.0-alpha (c0a0483)).

  • Every IP in the range 192.168.121.0/24
  • A sample of IPs from the range 192.168.0.0/16.
  • Random IPv6 address from lots of different ranges.

I checked the sorting for the initial sorting order, and after clicking the header to sort ascending and descending.

(For IPv6 I only checked initial sorting order, as the asc/desc will be fixed in T255694.)

They all appear in the correct order (i.e. numerical order).

Example of the now correct initial sorting (compare to the screenshot in the description):

initial_sorting_order_ipv4.png (243×334 px, 3 KB)

Example from IPv6. 2001:df0:8b:6a1:225c:3a92:cacd:b6c3 now correctly comes before 2001:df0:8b:5c4d:9f4e:741d:ebc8:f374, because the former is implicitly 2001:df0:8b:06a1:225c:3a92:cacd:b6c3:

initial_sorting_order_ipv6.png (161×396 px, 3 KB)