Bug Description
In src/context/AppContext.jsx, when a user explores an organization with a Personal Access Token (PAT) connected, the application attempts to fetch the contributors for all repositories simultaneously without batching or concurrency limits.
If a user explores a large organization (e.g., one with 200+ repositories), the explore() function fires hundreds of concurrent requests to the /contributors endpoint via Promise.allSettled(top.map(...)).
This triggers GitHub's Secondary Rate Limits (abuse mechanisms), resulting in immediate 403 Forbidden errors and temporarily banning the user's PAT/IP address. Additionally, queuing this many simultaneous requests can freeze browser networking.
Steps to Reproduce
- Add a Personal Access Token in Settings.
- Search for a very large organization (e.g.,
google, facebook, or microsoft).
- Open the Network tab in DevTools.
- Notice that hundreds of
/contributors requests are dispatched at the exact same time, eventually failing with 403 abuse blocks.
Expected Behavior
The explore() function should fetch contributors in small, manageable batches (e.g., 5 at a time) to respect GitHub's concurrency guidelines, similar to how the runAudit() function already handles issue fetching.
Proposed Fix
Replace the unbounded .map block in explore() (around line 112) with a batching loop:
// Process in safe batches of 5 to prevent abuse bans
for (let i = 0; i < top.length; i += 5) {
const batch = top.slice(i, i + 5);
await Promise.allSettled(batch.map(async repo => {
contribsPerRepo[`${org.login}/${repo.name}`] = await fetchContributors(org.login, repo.name, pat);
}));
}
I would love to open a PR to implement this fix!
Bug Description
In
src/context/AppContext.jsx, when a user explores an organization with a Personal Access Token (PAT) connected, the application attempts to fetch the contributors for all repositories simultaneously without batching or concurrency limits.If a user explores a large organization (e.g., one with 200+ repositories), the
explore()function fires hundreds of concurrent requests to the/contributorsendpoint viaPromise.allSettled(top.map(...)).This triggers GitHub's Secondary Rate Limits (abuse mechanisms), resulting in immediate
403 Forbiddenerrors and temporarily banning the user's PAT/IP address. Additionally, queuing this many simultaneous requests can freeze browser networking.Steps to Reproduce
google,facebook, ormicrosoft)./contributorsrequests are dispatched at the exact same time, eventually failing with403abuse blocks.Expected Behavior
The
explore()function should fetch contributors in small, manageable batches (e.g., 5 at a time) to respect GitHub's concurrency guidelines, similar to how therunAudit()function already handles issue fetching.Proposed Fix
Replace the unbounded
.mapblock inexplore()(around line 112) with a batching loop:I would love to open a PR to implement this fix!