Page MenuHomePhabricator

usercontribs API returns out-of-order edits for IP range queries
Open, Needs TriagePublicBUG REPORT

Description

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

What happens?:

The first query returns an edit made at 2023-04-06T10:07:20Z.

The second link displays an edit made at 2025-08-24T11:13:48.

What should have happened instead?:

The first query should start with the most recent edit from that IP range (i.e., the one displayed by the second link). It should not be necessary to fetch every single edit to find the most recent edits for an IP range. It's tens if not hundreds of thousands of edits for this /16. It's even worse for many other IP ranges. This is also an issue for smaller ranges, this is just one example.

In general, when using ucdir=older (the default), IP range usercontribs queries should always be ordered by the timestamp, not individual IP addresses in the IP range. And ucdir=newer should also be ordered by the timestamp. (The interactive Special:Contributions page is properly ordered as expected.)

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

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

This is a significant issue for administrative gadgets, user scripts, and bots that do anything related to IP ranges.