Skip to content

fix(bounties): cap top hunters submissions fan-out and forward query signal#1004

Open
blinkeye-lcm wants to merge 1 commit intoentrius:testfrom
blinkeye-lcm:fix/bounty-sidebar-top-hunters-fanout
Open

fix(bounties): cap top hunters submissions fan-out and forward query signal#1004
blinkeye-lcm wants to merge 1 commit intoentrius:testfrom
blinkeye-lcm:fix/bounty-sidebar-top-hunters-fanout

Conversation

@blinkeye-lcm
Copy link
Copy Markdown

Summary

The Top Hunters card in the bounty sidebar fans out one /issues/{id}/submissions request per recently completed bounty, capped at 50. On a cold /bounties visit 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:

  • Lower TOP_HUNTERS_FETCH_LIMIT from 50 to 15. The displayed leaderboard is capped at five rows by topN, so a sample of 15 keeps the ranking representative without burning a full per-origin connection budget on first paint.
  • Forward the TanStack Query signal through fetchIssueSubmissions to axios.get, matching the cancellation pattern already used in CodeViewer, ContributingViewer, and ReadmeViewer. Navigating away from /bounties mid-load now cancels the in-flight requests cleanly.
  • Extract getIssueSubmissionsQueryKey in src/api/IssuesApi.ts, mirroring the existing getIssuesQueryKey helper, 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 useMediaQuery gate was deliberately not added. The bounty sidebar still renders at full width below the issues list under the xl breakpoint, so gating the hook would prevent mobile visitors from ever seeing the leaderboard.

Related Issues

Closes #1003

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Screenshots

No visual change. Verified via DevTools Network on a cold load of /bounties: the request count for /issues/{id}/submissions drops from up to 50 down to at most 15, and in-flight requests flip to canceled when navigating away mid-load.

Checklist

  • New components are modularized/separated where sensible
  • Uses predefined theme (e.g. no hardcoded colors)
  • Responsive/mobile checked
  • Tested against the test API
  • npm run format and npm run lint:fix have been run
  • npm run build passes
  • Screenshots included for any UI/visual changes

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Top Hunters card on /bounties fires up to 50 parallel /submissions requests on first load

1 participant