Skip to content

[BUG] Repository list fetches all repos in a single API call with no pagination, causing failures for users with more than 100 repositories #2843

Description

@anshul23102

Problem

The GitHub REST API returns a maximum of 100 repositories per page. The current implementation calls /user/repos?per_page=100 once and uses only that first page. Users who have more than 100 repositories (common for active developers) see an incomplete repo list on the dashboard. Pull request metrics and streak calculations derived from that list are therefore also incomplete.

Steps to Reproduce

  1. Authenticate as a user with more than 100 GitHub repositories
  2. Open the dashboard and view the repository list
  3. Count the displayed repos and compare with the GitHub profile count
  4. Confirm repos beyond 100 are missing

Proposed Fix

Paginate through all pages until a response returns fewer than per_page items:

async function fetchAllRepos(token: string) {
  const repos = [];
  let page = 1;
  while (true) {
    const batch = await fetchGitHubRepos(token, page, 100);
    repos.push(...batch);
    if (batch.length < 100) break;
    page++;
  }
  return repos;
}

Cache the result to avoid N paginated requests on every page load.

Complexity: Level 2 | Program: GSSOC '26

Metadata

Metadata

Assignees

Labels

gssoc:assignedGSSoC: Issue assigned to a contributor

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions