You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GitHub repository discovery spends 2–3 list calls per owner every refresh (GET /user each time, org repos listed twice, 404 for users) #343
UpdateRepositoriesAsync (BuildMonitor/Providers/GitHub.cs ~L229-L286) does the following for every owner on every 300 s refresh:
It calls User.Current() only to compare the login with the owner name. The authenticated login does not change between refreshes.
For any owner that is not the authenticated user, it calls both GetAllForUser(owner) and GetAllForOrg(owner):
For an organization, /users/{org}/repos returns the org's public repos, and /orgs/{org}/repos returns them again along with the private ones. Every public repo is paged through twice, because Octokit's GetAll* reads every page.
For a plain user, GetAllForOrg always returns 404, which wastes one request per user per refresh.
The GetOrAdd loop then drops the duplicates.
Cost
For an org with 300 public repos, each refresh costs 1 + 3 + 3 = 7 requests instead of 3. That is about 48 extra requests per hour for one owner. With several owners, discovery takes a noticeable share of a budget that #331 and #333 already show is tight.
Suggested fix
Cache the authenticated login per token. Read it once and clear it when the token changes.
Decide once whether an owner is a user or an organization (/users/{name} returns type), and store the answer on Owner.
Then make exactly one paginated list call per refresh:
GetAllForCurrent (filtered) for the authenticated user
GetAllForOrg for organizations
GetAllForUser for other users
Acceptance criteria
Discovery for an organization makes one paginated list call per refresh, and no /user call after the first.
Discovery for a non-authenticated user makes no /orgs/... call.
Next step: Cache the authenticated login per token, and store each owner's user/org kind once. Then make exactly one paginated list call per owner per refresh.
Activity
matt-edmondson commentedon Oct 6, 2026
Triage
BuildMonitor/Providers/GitHub.cs:UpdateRepositoriesAsyncGenerated by Claude Code