Skip to content

fix(config): reconcile stale org/repo scope references - #122

Merged
wgordon17 merged 1 commit into
gordon-code:mainfrom
wgordon17:fix/stale-scope-reconciliation
Aug 6, 2026
Merged

fix(config): reconcile stale org/repo scope references#122
wgordon17 merged 1 commit into
gordon-code:mainfrom
wgordon17:fix/stale-scope-reconciliation

Conversation

@wgordon17

Copy link
Copy Markdown
Member

Summary

  • selectedOrgs could retain logins no longer returned by fetchOrgs() (revoked/removed access), inflating the "N of M selected" counter past its live total — fixed by paginating fetchOrgs() fully and pruning stale entries with a notification
  • customTabs[].orgScope/repoScope had the same missing-reconciliation bug as monitoredRepos (which already prunes correctly) — updateConfig() now prunes both when selectedRepos shrinks
  • Empty custom tab scope now means "match nothing" instead of silently "match all repos", with a warning icon (TabBar + Settings) so an unscoped tab is never a silent state

@wgordon17
wgordon17 marked this pull request as ready for review August 6, 2026 15:09
@wgordon17
wgordon17 requested a review from a team August 6, 2026 15:09
selectedOrgs could retain logins no longer returned by fetchOrgs()
(revoked/removed org access), inflating the "N of M selected" counter
past its live total. fetchOrgs() itself only fetched a single page,
so fixing that counter safely required paginating it first — done via
octokit.paginate.iterator, matching fetchRepos(). OrgSelector now
prunes stale selectedOrgs entries once a full fetch resolves and
notifies the user.

customTabs[].orgScope/repoScope had the same class of bug: nothing
reconciled them when selectedRepos shrank, unlike monitoredRepos which
already did. updateConfig() now prunes both scope arrays the same way.

Since scope pruning can empty a tab's scope entirely, and empty scope
previously meant "match all repos" (a silent, surprising expansion),
empty scope now means "match nothing" instead, with a warning icon on
the tab (TabBar and Settings) so it's never a silent state.

Added a structural regression test enumerating every config field that
derives from selectedRepos, so a future field added without
reconciliation fails the suite by default.
@wgordon17
wgordon17 force-pushed the fix/stale-scope-reconciliation branch from 6519341 to 13634e5 Compare August 6, 2026 15:14
@wgordon17
wgordon17 merged commit f14728d into gordon-code:main Aug 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant