Page MenuHomePhabricator

IP reveal: On a live updating page, only make new IP reveal API requests for the added data
Open, In Progress, Needs TriagePublic

Description

Background

Special:RecentChanges is an example of a live updating page: new revisions are added to the page as they are made in real time. This happens if the user puts the page into updating mode.

On this type of page, we are making potentially unnecessary requests to the IP reveal API whenever the page is updated.

This specifically affects Special:RecentChanges and Special:Watchlist, since they are the live updating pages on which IP reveal is enabled.

Technical notes

What happens when new content is added

  • When new content is added to a live updating page, it fires a hook, 'wikipage.content', which passes the DOM (from <div class=mw-changeslist"> down)
  • The new content is separated from the old content with a <div class="mw-rcfilters-ui-changesListWrapperWidget-previousChangesIndicator">

What API calls are we making

  • We request all the IP addresses for all the revisions on the page made by recently-revealed temporary users, each time the page updates
  • See the code here

What should we do instead

  • We should only request IP addresses for the newly added revisions made by recently-revealed users
  • We could do this by passing in only the recently added content to ipReveal.revealRecentlyRevealedUsers when the page updates itself

Acceptance criteria

  • When Special:RecentChanges and Special:Watchlist update with no revisions from recently-revealed users, no API requests should be made
  • When Special:RecentChanges and Special:Watchlist update with some revisions from recently-revealed users, API requests should only be made for the newly added revisions by the recently-revealed users

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Making this a major pilots blocker since we should solve it before we implement IP auto-reveal, which is a blocker.

mszabo changed the task status from Open to In Progress.Feb 10 2025, 12:33 PM
mszabo claimed this task.

Following a discussion with @mszabo, this is more complicated than it looks and would involve caching the IPs, and the making some decisions about whether to use cached values for the grouped changes. We've heard feedback about grouped changes in the past (e.g. T331369), so we should be careful about changing that.

This isn't necessary for auto-reveal, now that we are looking up IPs in batches, so I'll remove the blocker tag.

Dreamy_Jazz added a subscriber: mszabo.