Revert "fix(dashboard): revalidate GitHub caches when installation access changes"#145
Revert "fix(dashboard): revalidate GitHub caches when installation access changes"#145
Conversation
📝 WalkthroughWalkthroughThis PR removes the GitHub App installation access indexing feature, including cache policies, revalidation signals, repository visibility filtering, type definitions, the Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
diffkit | 31bf18c | Apr 17 2026, 05:28 AM |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/dashboard/src/lib/github.functions.ts`:
- Around line 4043-4044: The caches using signalKeys/namespaceKeys of
githubRevalidationSignalKeys.pullsMine (and the similar one for "My Issues")
only key by { username } but also depend on the current installation set from
getMySearchSources(); update the cache key and signals so installation changes
invalidate them: include a stable installation identifier (e.g., a sorted list
or fingerprint of getMySearchSources() results or an installation IDs array) in
the cache key for the functions that build "My Pulls"/"My Issues", and add the
corresponding installation-change revalidation key (e.g.,
githubRevalidationSignalKeys.installations or an installations-specific signal)
to both signalKeys and namespaceKeys alongside
githubRevalidationSignalKeys.pullsMine so granting/revoking installs triggers
invalidation (also apply the same change to the other affected cache referenced
by lines ~4230-4231).
- Around line 1516-1524: The current code only fetches the first page of GET
/user/installations (per_page: 100), causing missing installations when there
are >100; update the fetch to paginate and collect all pages before calling
mapGitHubAppInstallations. Replace the single request using
appUserOctokit.request in the block that creates installationsResponse with a
paginated fetch (e.g., appUserOctokit.paginate or looping with page param) to
accumulate all installation items into a single array, then pass that full array
into mapGitHubAppInstallations so callers receive the complete installations
list.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8199a6a8-ef22-4941-82dd-7a66d4e9f6e9
📒 Files selected for processing (9)
apps/dashboard/src/components/layouts/github-access-dialog.tsxapps/dashboard/src/lib/github-access.test.tsapps/dashboard/src/lib/github-access.tsapps/dashboard/src/lib/github-cache-policy.tsapps/dashboard/src/lib/github-revalidation.tsapps/dashboard/src/lib/github.functions.tsapps/dashboard/src/lib/github.types.tsapps/dashboard/src/lib/use-refresh-on-return.tsapps/dashboard/src/routes/setup.tsx
💤 Files with no reviewable changes (8)
- apps/dashboard/src/routes/setup.tsx
- apps/dashboard/src/components/layouts/github-access-dialog.tsx
- apps/dashboard/src/lib/github.types.ts
- apps/dashboard/src/lib/github-cache-policy.ts
- apps/dashboard/src/lib/github-access.test.ts
- apps/dashboard/src/lib/github-revalidation.ts
- apps/dashboard/src/lib/use-refresh-on-return.ts
- apps/dashboard/src/lib/github-access.ts
| const installationsResponse = await appUserOctokit.request( | ||
| "GET /user/installations", | ||
| { | ||
| per_page: 100, | ||
| }, | ||
| ); | ||
| const installations = mapGitHubAppInstallations( | ||
| installationsResponse.data as GitHubUserInstallationsPayload, | ||
| ); |
There was a problem hiding this comment.
Restore pagination when loading app installations.
Line 1516 now reads only the first page of GET /user/installations. Every caller here treats this list as complete, so accounts with more than 100 installations will silently miss owners, search sources, and access-state entries.
🐛 Proposed fix
- const installationsResponse = await appUserOctokit.request(
- "GET /user/installations",
- {
- per_page: 100,
- },
- );
- const installations = mapGitHubAppInstallations(
- installationsResponse.data as GitHubUserInstallationsPayload,
- );
+ const installationItems =
+ await listPaginatedGitHubItems<GitHubUserInstallationPayload>({
+ label: "github app installations",
+ request: (page, signal) =>
+ appUserOctokit.request("GET /user/installations", {
+ page,
+ per_page: 100,
+ request: { signal },
+ }),
+ getItems: (payload) =>
+ (payload as GitHubUserInstallationsPayload).installations ?? [],
+ });
+ const installations = mapGitHubAppInstallations({
+ installations: installationItems,
+ });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/dashboard/src/lib/github.functions.ts` around lines 1516 - 1524, The
current code only fetches the first page of GET /user/installations (per_page:
100), causing missing installations when there are >100; update the fetch to
paginate and collect all pages before calling mapGitHubAppInstallations. Replace
the single request using appUserOctokit.request in the block that creates
installationsResponse with a paginated fetch (e.g., appUserOctokit.paginate or
looping with page param) to accumulate all installation items into a single
array, then pass that full array into mapGitHubAppInstallations so callers
receive the complete installations list.
| signalKeys: [githubRevalidationSignalKeys.pullsMine], | ||
| namespaceKeys: [githubRevalidationSignalKeys.pullsMine], |
There was a problem hiding this comment.
Keep an installation-change invalidation path for these caches.
These two caches still depend on the current installation set via getMySearchSources(), but the cache key here is only { username }. After a user grants or revokes installation access, “My Pulls” and “My Issues” can stay stale until the list stale time expires.
Also applies to: 4230-4231
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/dashboard/src/lib/github.functions.ts` around lines 4043 - 4044, The
caches using signalKeys/namespaceKeys of githubRevalidationSignalKeys.pullsMine
(and the similar one for "My Issues") only key by { username } but also depend
on the current installation set from getMySearchSources(); update the cache key
and signals so installation changes invalidate them: include a stable
installation identifier (e.g., a sorted list or fingerprint of
getMySearchSources() results or an installation IDs array) in the cache key for
the functions that build "My Pulls"/"My Issues", and add the corresponding
installation-change revalidation key (e.g.,
githubRevalidationSignalKeys.installations or an installations-specific signal)
to both signalKeys and namespaceKeys alongside
githubRevalidationSignalKeys.pullsMine so granting/revoking installs triggers
invalidation (also apply the same change to the other affected cache referenced
by lines ~4230-4231).
This reverts commit 4f54751.
Summary by CodeRabbit
Release Notes
Removed Features
Improvements
Tests