fix(mobile): harden push/auth flows and notification release setup#97
Conversation
…identity-scoped query cache
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Deployment failed with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
- write cal_auth_user_id in loginFromWebSession so web-session users keep persisted cache - treat backend 404 on unregister as already-gone (region-aware) and clear stale record - resolve a differing previous push registration before overwriting it - add safe, PII-free logs (region, userId, deviceId, token hash) to push cleanup paths
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
…registration races Addresses parallel-review findings: - #1/#2: add a monotonic auth generation (epoch) bumped on clearAuth and every new login. Refreshes discard their result if the epoch changed mid-flight, and 401 retries abort instead of replaying a stale request under a new identity. - #3: loginFromWebSession now clears the query cache before flipping auth state so a previous user's in-memory cache can't be re-persisted under the new owner. - #4: a registration that completes after logout/switch is not persisted as the active record; it is parked for retry instead of leaving a live subscription. - #5: compare the full {token,userId,region,deviceId} tuple and keep unresolved prior registrations in a retry queue instead of clobbering the single slot.
…back marker + late-registration cleanup
…ion lock; pre-POST generation check for push registration
…talling refresh fn
…lock, region-safe cache envelope, pending-queue cap
…ogout user; serialize pending-queue mutations
…ck to avoid logout re-entry deadlock
…ion before persisting push registration
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
…ewer one to avoid losing late re-registrations
|
You're iterating quickly on this pull request. To help protect your rate limits, cubic has paused automatic reviews on new pushes for now—when you're ready for another review, comment |
Summary
Mobile release hardening for Companion push notifications, auth/refresh handling, persisted query cache ownership, and notification build setup.
This PR started as push/auth/cache hardening and now also includes the final mobile release fixes found during device/build testing: Android Firebase config loading through EAS secrets, Android notification channel setup, iOS notification handler deprecation cleanup, booking action auth UX, dev-only app-review prompt suppression, and removal of temporary debug logs.
What Changed
Push notifications
shouldShowAlertusage in favor ofshouldShowBanner/shouldShowList.Auth and session safety
runAuthTransition()to serialize short auth-marker storage mutations without holding the lock across network I/O./me401 can refresh instead of logging the user out.Query cache isolation
{ region, userId }.Booking action UX and logs
Release/build setup
1.0.8.google-services.jsonfrom theGOOGLE_SERVICES_JSONEAS file secret viaapp.config.js.google-services.jsonin Git and EAS upload paths so the Firebase config is not committed to the public repo.Important Context
GOOGLE_SERVICES_JSONfile secret. Those credentials are not committed in this PR.Verification
Local checks run on this branch:
bun --filter mobile typecheckbun --filter mobile lint:react-compilergit diff --checkGOOGLE_SERVICES_JSON=./google-services.json bunx expo config --jsonGOOGLE_SERVICES_JSON=./google-services.json bunx expo export --platform androidManual/device checks performed during release testing:
Reviewer Checklist
GOOGLE_SERVICES_JSONconfigured as an EAS file secret and FCM V1 credentials assigned.Link to Devin session: https://app.devin.ai/sessions/a3bc1b9f3e3845ef8f795f2509c8a72d
Requested by: @dhairyashiil