Bug: Commit search only fetches the first page of results
While looking into some inaccurate contribution metrics, I noticed that fetchCommitSearch in route.ts (around line 53) only makes a single GitHub Search API request with per_page=100.
The problem is that GitHub search results are paginated, so for users with more than 100 matching commits we're only processing the first page of data. This causes several metrics to be undercounted or skewed, including:
- total commits
- most active repo
- active contribution days
- contribution deltas/trends
Proposed fix
Update fetchCommitSearch to paginate through all available search results instead of stopping after the first request.
Suggested approach:
- Request results with:
- Keep fetching pages until:
- fewer than 100 items are returned
- we've reached
total_count
- or we hit GitHub Search API's 1000-result cap
- Aggregate all returned items before returning the final response
Expected return shape should still look like:
Bug: Commit search only fetches the first page of results
While looking into some inaccurate contribution metrics, I noticed that
fetchCommitSearchinroute.ts(around line 53) only makes a single GitHub Search API request withper_page=100.The problem is that GitHub search results are paginated, so for users with more than 100 matching commits we're only processing the first page of data. This causes several metrics to be undercounted or skewed, including:
Proposed fix
Update
fetchCommitSearchto paginate through all available search results instead of stopping after the first request.Suggested approach:
per_page=100page=Ntotal_countExpected return shape should still look like: