fix(bounties): cap top hunters submissions fan-out and forward query signal#1004
Open
blinkeye-lcm wants to merge 1 commit intoentrius:testfrom
Open
fix(bounties): cap top hunters submissions fan-out and forward query signal#1004blinkeye-lcm wants to merge 1 commit intoentrius:testfrom
blinkeye-lcm wants to merge 1 commit intoentrius:testfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Top Hunters card in the bounty sidebar fans out one
/issues/{id}/submissionsrequest per recently completed bounty, capped at 50. On a cold/bountiesvisit that means up to 50 parallel HTTP calls against the same origin, most queued behind the browser per-origin connection limit, and the card sits in its skeleton state until the queue drains. Navigating away mid-load also leaks in-flight requests because the TanStack Query signal is not forwarded to axios.Three small changes scoped to the bounty sidebar resolve both:
TOP_HUNTERS_FETCH_LIMITfrom 50 to 15. The displayed leaderboard is capped at five rows bytopN, so a sample of 15 keeps the ranking representative without burning a full per-origin connection budget on first paint.signalthroughfetchIssueSubmissionstoaxios.get, matching the cancellation pattern already used inCodeViewer,ContributingViewer, andReadmeViewer. Navigating away from/bountiesmid-load now cancels the in-flight requests cleanly.getIssueSubmissionsQueryKeyinsrc/api/IssuesApi.ts, mirroring the existinggetIssuesQueryKeyhelper, and reuse it from the bounty-hunters fan-out. The shared cache entry with the bounty-details page (useIssueSubmissions) is preserved through the helper instead of a duplicated key shape.A
useMediaQuerygate was deliberately not added. The bounty sidebar still renders at full width below the issues list under thexlbreakpoint, so gating the hook would prevent mobile visitors from ever seeing the leaderboard.Related Issues
Closes #1003
Type of Change
Screenshots
No visual change. Verified via DevTools Network on a cold load of
/bounties: the request count for/issues/{id}/submissionsdrops from up to 50 down to at most 15, and in-flight requests flip to canceled when navigating away mid-load.Checklist
npm run formatandnpm run lint:fixhave been runnpm run buildpasses