fix: resolve local dev mode crashes (Firebase mock + wrong parsing endpoint)#417
fix: resolve local dev mode crashes (Firebase mock + wrong parsing endpoint)#417sharwariakre wants to merge 2 commits into
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ 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: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR updates Firebase mock authentication to use in-memory persistence and extends the mock user object with required SDK methods, while also remapping the parsing status service endpoint from ChangesFirebase Mock Auth and Service Endpoint
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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. Comment |
Summary
Two bugs that affect every contributor running locally without Firebase credentials.
Bug 1: Firebase
_stopProactiveRefreshcrash on page reloadFile:
configs/Firebase-config.ts,lib/utils.tsWhen running in mock Firebase mode (no
NEXT_PUBLIC_FIREBASE_API_KEYset), the app crashes on page reload with:TypeError: auth.currentUser._stopProactiveRefresh is not a function
Root cause:
getAuth()usesindexedDBLocalPersistenceby default. On reload, Firebase restores the previously persisted mock user from IndexedDB and calls_stopProactiveRefresh()on the plain JSON object, which does not have that method.Fix: Switch to
initializeAuth(firebase_app, { persistence: inMemoryPersistence })so Firebase never writes or restores auth state from IndexedDB. Also added_stopProactiveRefreshand_startProactiveRefreshstubs togenerateMockUser()as a secondary guard.Bug 2: Parsing status always returns 404
File:
services/BranchAndRepositoryService.tsAfter submitting a repo for parsing, the status never updates — the request silently fails with a 404.
Root cause:
checkParsingStatus()was calling/api/v1/check-statuswhich does not exist. The correct backend route is/api/v1/parsing-status.Fix: Updated the endpoint to match the actual backend route.
Note
QuestionSection.tsxhas a pre-existing TypeScript error unrelated to this fix — the build was already failing onmainbefore these changes.Test plan
_stopProactiveRefreshcrash in consoleSummary by CodeRabbit