Fix cold-start rate-limit dialog and suppress sign-in hint when signed in#507
Conversation
… stop cold-start rate-limit dialog
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThis PR updates dependency injection wiring to add ChangesAuthentication-Aware Rate-Limiting and Backend API Integration
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Two fixes that didn't make it into #506 before merge.
1. Cold-start rate-limit dialog (the actual bug user reported)
`MainViewModel.init` runs `installedAppsRepository.checkAllForUpdates()` on every cold start. That fans out N direct GitHub calls (one per tracked app) via `fetchReleaseWindow`. With anon's 60/hr GitHub limit, users with 30+ tracked apps hit the ceiling on first launch — `RateLimitInterceptor` parses the `X-RateLimit-Remaining: 0` header and fires the global `RateLimitDialog` ("Resets in 31 minutes").
PR #505 didn't catch this because it touched feature-level repos (apps, dev-profile, starred), not the `InstalledAppsRepository` cold-start fan-out.
Fix: `fetchReleaseWindow` now goes backend-first via `backendApiClient.getReleases`, falls back to direct GitHub on backend 5xx/infra. Backend pool absorbs the cold-start burst (20k/hr aggregate via 4 PATs) instead of anon hitting 60/hr.
2. Sign-in hint shown to already-signed-in users
The retry-after toast in DetailsViewModel always appended "Sign in to GitHub for a higher quota." Pointless when user is already signed in. Now gated on `authenticationState.isCurrentlyUserLoggedIn()`.
`AuthenticationState` injected into `DetailsViewModel`; DI updated in `ViewModelsModule`.
Test plan
Summary by CodeRabbit