Skip to content

Activity tab - Dedupe in-flight summary requests#5679

Merged
tonisevener merged 4 commits intomainfrom
dedupe-summary-requests
Feb 10, 2026
Merged

Activity tab - Dedupe in-flight summary requests#5679
tonisevener merged 4 commits intomainfrom
dedupe-summary-requests

Conversation

@tonisevener
Copy link
Collaborator

@tonisevener tonisevener commented Feb 10, 2026

Phabricator: https://phabricator.wikimedia.org/T417033

Notes

When watching network calls for instrumentation, I noticed a large influx of calls to the page/summary endpoint with the same title. For my particular account, it was partly due to a lot of edits to the same article (my user talk page). Since they are all distinct items on the timeline, they all tried fetching the summary at the same time. The existing caching didn't work yet because the first summary fetch had not yet completed.

This PR dedupes these by keeping track of a dictionary of in-flight requests. Once the first one starts, the next ones simply queue up the completion handler. Then once the first one completes, it calls all of the completion handlers.

Test Steps

  1. Make several edits to the same article.
  2. Re-launch the app, watch the network calls and ensure only one call is made to the summary endpoint (looks like https://en.wikipedia.org/api/rest_v1/page/summary/{article title}) per-title.

Screenshots/Videos

@tonisevener tonisevener requested review from a team and l-olson1214 and removed request for a team February 10, 2026 14:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to reduce duplicate REST page/summary calls by deduping concurrent (in-flight) summary requests per title for the Activity tab.

Changes:

  • Updates the Growth Tasks data controller test to use the shared WMFArticleSummaryDataController instance (instead of constructing a new one), aligning with a singleton-based summary fetching approach.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@l-olson1214 l-olson1214 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Should we set up some service like this that can be reused elsewhere (checks if something's in flight? Is that possible to make generic?)

@tonisevener tonisevener merged commit 52bfb62 into main Feb 10, 2026
11 of 12 checks passed
@tonisevener tonisevener deleted the dedupe-summary-requests branch February 10, 2026 19:41
@tonisevener
Copy link
Collaborator Author

LGTM! Should we set up some service like this that can be reused elsewhere (checks if something's in flight? Is that possible to make generic?)

Good idea, tracking this here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants