GitHub cache: fresher My lists, repo-scoped invalidation#152
Conversation
Introduce a shorter mine policy for My pulls/issues/reviews on client and server, refresh mine aggregates without merging closed items back from cache, and shorten the signal poll fallback. Scope repo list and repo-filtered user search caches to repoMeta instead of global mine keys to cut spurious refetches and rate-limit churn.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 8 minutes and 6 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis pull request optimizes cache behavior for user-scoped GitHub data (pulls, issues, reviews). It introduces a new cache policy with shorter stale time and updates cache invalidation to use more granular, scoped keys instead of global ones, while also reducing the polling interval for signal updates. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
diffkit | 8e903b9 | Apr 18 2026, 03:19 AM |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 4475-4494: The merge functions mergeMyPullsCachedWithFresh and
mergeMyIssuesCachedWithFresh incorrectly use fresh.timedOut to decide whether to
union with existing cache; change the logic to use a new per-fetch boolean
(e.g., partial or incomplete) that you set only when the aggregate actually
missed one of its own sources, and leave timedOut for the global UI/telemetry
signal (keep hasRecentGitHubTimeouts() setting timedOut in
getMyPullsResult/getMyIssuesResult but do not use it for merge decisions);
update the merge callers (including the other occurrences at the noted ranges)
to check fresh.partial (or fresh.incomplete) instead of fresh.timedOut so fully
successful refreshes are not merged with stale cache entries.
🪄 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: bc99c77d-b9d8-4c2f-b7aa-8850e064a5eb
📒 Files selected for processing (4)
apps/dashboard/src/lib/github-cache-policy.tsapps/dashboard/src/lib/github.functions.tsapps/dashboard/src/lib/github.query.tsapps/dashboard/src/lib/use-github-signal-stream.ts
CodeRabbit: timedOut is also set via hasRecentGitHubTimeouts(), so using it for cache union could resurrect stale rows after an unrelated timeout. Introduce partial when results.length < sources.length and use that for mergeMyPullsCachedWithFresh / mergeMyIssuesCachedWithFresh only.
This PR tightens caching for user-facing "My" aggregates and fixes overly broad server cache invalidation for repo-scoped lists.
My pulls / issues / reviews
minepolicy (30s clientstaleTime, 15mgcTime) and use it forgithubMyPullsQueryOptions/githubMyIssuesQueryOptionsand the matching GraphQL mine resourcesfreshForMs.timedOut), so merged/closed items are not resurrected from older cache after webhook-driven refetch.Signals / rate limit
pulls.repo,issues.repo) now key revalidation offrepoMeta:owner/repoinstead of globalpulls.mine/issues.mine, avoiding unnecessary refetches across all users and repos.getPullsFromUser,getIssuesFromUser) usesrepoMetaonly whenownerandrepoare set; otherwise TTL only (no incorrect global mine coupling).Resilience
Summary by CodeRabbit
New Features
Bug Fixes