[BUG]: Complete Analysis can silently skip repositories when the PAT has access to private repos
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github, javascript
Research direction
Start with fetchRepos in src/services/github.js and the call in src/context/AppContext.jsx; the issue includes a reproduction using a stubbed fetch that returns 100 repositories, then 50. First read the repository fetching tests and check how the project defines Complete Analysis scope. Done when the test confirms the intended repositories are all fetched and the existing tests pass.
Written by the indexing model from the issue text.
Description
Bug Description
Summary
With a Personal Access Token configured, fetchRepos decides how many pages to request based on the organization's public repository count. If the token can also see private repositories, GitHub returns more repositories than that count, and the remaining pages are never requested. Those repositories are silently missing from the analysis.
Root cause
In src/services/github.js:
export async function fetchRepos(org, repoCount, pat) {
const all = []
const maxPages = pat ? Math.ceil(repoCount / 100) : 5
for (let page = 1; page <= maxPages; page++) {
const url = `https://api.github.com/orgs/${org}/repos?per_page=100&page=${page}&sort=updated`
const data = await fetchWithCache(url, pat)
all.push(...data)
if (data.length < 100) break
}
return all
}
src/context/AppContext.jsx calls it as:
fetchRepos(org.login, org.public_repos, pat)
The request URL does not set a type parameter, so for an authenticated token the /orgs/{org}/repos endpoint returns every repository the token can access, including private ones. The page limit, however, is calculated from org.public_repos only. When the token can see more repositories than public_repos, the loop reaches maxPages and stops, even though GitHub still has more full pages to return.
For example, with public_repos = 50 and 150 repositories visible to the token, maxPages is 1, so only the first 100 repositories are fetched and the remaining 50 are dropped.
Impact
- Total Repos, the Repositories page, and the analytics built on them can be based on an incomplete list, with no indication that data is missing.
- Private repositories can also be included in the results, while the "Learn More" panel describes Complete Analysis as covering all public repositories.
This only affects users whose token has access to private repositories in the analyzed organization.
Possible fixes
Either of these would resolve it, depending on the intended scope of Complete Analysis:
- Fetch public repositories only, by adding
type=publicto the request. This matches the "Learn More" description, andpublic_reposthen becomes an accurate page count. - Keep paginating until GitHub returns a page with fewer than 100 items, instead of deriving the limit from
public_repos(with a reasonable safety cap).
I'd be happy to work on this once the preferred approach is confirmed.
Steps to Reproduce
The issue can be reproduced with a unit test against the current main branch, by stubbing fetch to serve 150 repositories across two pages while public_repos is 50:
// fetch is stubbed to return 100 repos for page 1 and 50 repos for page 2
const result = await fetchRepos('some-org', 50, 'pat-token')
expect(result).toHaveLength(150)
Result:
AssertionError: expected 100 to be 150
Only the first page is requested, because maxPages = Math.ceil(50 / 100) = 1.
Real-world reproduction:
- Add a PAT in Settings that has access to private repositories of an organization.
- Explore that organization.
- Compare the number of repositories shown with the number visible to the token on GitHub. If the token can see more repositories than the organization's public count, some are missing.
Expected: all repositories in scope are fetched.
Actual: fetching stops after ceil(public_repos / 100) pages, and the remaining repositories are skipped.
Logs and Screenshots
Test output from npx vitest run:
AssertionError: expected 100 to be 150 // Object.is equality
- Expected
+ Received
- 150
+ 100
Environment Details
- Branch: upstream
main(as of 21 October 2026) - Reproduced with:
npx vitest run - Files:
src/services/github.js(fetchRepos),src/context/AppContext.jsx
Impact
Critical - Application is unusable
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- Dominant language
- JavaScript
- Stars
- 53
- Forks
- 187
- Avg merge
- 18m
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AOSSIE-Org/OrgExplorer
-
[BUG]: Organization filter dropdown in AnalyticsPage renders empty list due to truthy evaluation of empty issuesDataPossibly taken @havyasreekuppam claimed this 5 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
AOSSIE-Org/OrgExplorer#476 · 5 comments ·
Maintainers usually reply within 1 day
-
Add Pat for 5000 req/hr button not visible when pat expiresPossibly taken @Rajvardhan-Singh-Rathore claimed this 6 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
AOSSIE-Org/OrgExplorer#473 · 6 comments ·
Maintainers usually reply within 1 day
-
[BUG]: PAT popup input lacks label association and visibility button lacks an accessible namePossibly taken @prasanm1423 claimed this 10 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/OrgExplorer#466 · 2 comments ·
Maintainers usually reply within 1 day
-
[FEATURE]: Set dynamic document.title based on active page routePossibly taken @23241a6749 claimed this 8 days ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/OrgExplorer#462 · 2 comments ·
Maintainers usually reply within 1 day
-
[BUG]: SocialShareButton logs unconditional console.warn when script is not loadedPossibly taken @vivekrajputofficial29-afk claimed this 8 days ago. Openbug enhancement
Difficulty 1/5 Under an hour Newbie friendliness 89/100
AOSSIE-Org/OrgExplorer#461 · 1 comment ·
Maintainers usually reply within 1 day
All issues in AOSSIE-Org/OrgExplorer
Similar issues
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Kanevry/session-orchestrator#108 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
awesomemotive/all-in-one-seo-pack#3238 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
andromarces/agent-loops#2055 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days