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