Skip to content

fix: paginate up to 1000-item cap when total_count exceeds it#1

Merged
costajohnt merged 1 commit into
mainfrom
fix/paginate-past-1000-cap
May 6, 2026
Merged

fix: paginate up to 1000-item cap when total_count exceeds it#1
costajohnt merged 1 commit into
mainfrom
fix/paginate-past-1000-cap

Conversation

@costajohnt
Copy link
Copy Markdown
Owner

Summary

  • paginateSearch returned only page 1 (100 items) whenever total_count >= maxItems, truncating topRepos, dailyActivity, and streak for users with 1000+ merged PRs in the last 12 months.
  • Most-recently-updated PRs (often in the user's own/work repos) dominated page 1, hiding the external OSS tail from the aggregated view. End result on the card widget: 8 PRs / 3 repos shown for an account that should display 111 / 34 under the external + 50+ stars filter.
  • Fix clamps totalCount to maxItems and paginates to the GitHub Search API's 10-page cap. The cappedMerged flag is unaffected since it reads from total_count.

Test plan

  • pnpm test — 109/109 passing
  • pnpm run typecheck — clean
  • Updated flags capped results when total_count exceeds 1000 test to assert 12 search calls (10 merged pages + open + closed) and that topRepos reflects paginated items
  • After deploy, hit /api/card/costajohnt?cache=no and confirm 111 PRs / 34 repos

paginateSearch returned only page 1 (100 items) when total_count >= maxItems,
truncating topRepos, dailyActivity, and streak for users with 1000+ merged
PRs in the last 12 months. The most-recently-updated PRs (often in the user's
own/work repos) dominated page 1, hiding external OSS contributions from the
aggregated view.

Now clamps totalCount to maxItems and paginates to the GitHub Search API's
10-page cap, so the items array reflects up to 1000 PRs as intended.
@costajohnt costajohnt merged commit 24d6cd5 into main May 6, 2026
4 checks passed
@costajohnt costajohnt deleted the fix/paginate-past-1000-cap branch May 6, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant