fix: [SDK-5171] improve Firebase Installation ID configuration errors - #2745
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Multi-model review (Claude Opus 5, GPT 5.6 Sol, Cursor Grok 4.6) of the net diff vs main (16 files, +1006/−56). Typed FID diagnostics and the ProGuard register() keep are useful; the two follow-ups called out in the PR body are still present.
Act on
- FID
IOExceptions are wrapped asFCMInstallationIdExceptionand mapped to retryable-12(FIREBASE_FCM_ERROR_MISC_EXCEPTION).attemptRegistrationreturns on the first attempt, so the existing 5-attempt backoff andSERVICE_NOT_AVAILABLE/AUTHENTICATION_FAILEDstatuses never run on the FID path (3/3).
Consider
- Control flow treats any raw manifest value whose string form is
"true"as enabled. Firebase 25.1 andFidEnvuseBundle.getBoolean(), which isfalsefor a String"true"(2/3; Opus treated the raw read as the fix). NO_DEFAULT_FIREBASE_APP/REGISTER_API_UNAVAILABLEare permanent config misses but also become retryable-12, so they will not replace a prior success the way sender mismatch does.shouldUpdateErrorStatusoverwrites a healthy token for every non-retryable status (-7GMS disabled,-4missing FCM lib, HMS config errors), not justINVALID_FCM_SENDER_ID.- Docs require firebase-messaging 25.1.0; the module
requirerange is still[23.0.8, 24.0.99]. The new comment thatrequireis non-strict is incorrect (preferis the soft constraint).
Noted
- Carry-forwards from #2734/#2735: no
onRegistered()FID-rotation bridge; Play Services below261200000can makeregister()a V1 fallback; blank/"null"dashboard sender skips host fallback. - Mutex around token retrieve is reasonable; pair it with a
Tasks.awaittimeout if registration can stall.
Dismissed
- Demo
firebase_messaging_installation_id_enabled=false+tools:replaceis the documented override, not a sample of the new path.
Sent by Cursor Automation: PR Reviews
📊 Diff Coverage ReportDiff Coverage Report (Changed Lines Only)Gate: aggregate coverage on changed executable lines must be ≥ 80% (JaCoCo line data for lines touched in the diff). Changed Files Coverage
Overall (aggregate gate)87/90 touched executable lines covered (96.7% — requires ≥ 80%) |
Co-authored-by: Cursor <cursoragent@cursor.com>
nan-li
left a comment
There was a problem hiding this comment.
LGTM. Traced the three Cursor fixes through the final code and they hold: FID IOExceptions reach the existing retry loop, the flag is read the way Firebase reads it, and a healthy token now survives everything except a sender mismatch.
One nit, not blocking: the string "true" case only tests the provider with a prebuilt InstallationIdFlag, not installationIdFlag() itself. A PushRegistratorFCMTests case that puts a String "true" into the manifest Bundle and asserts the legacy token path would cover the real Bundle.getBoolean behavior Cursor flagged.
abdulraqeeb33
left a comment
There was a problem hiding this comment.
Nits only.
- The
-6wipe also covers the missing-sender early return, not just a detected mismatch. - Log
exception.messageon sender mismatch, same as the FID error helper.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed the remaining review nits in 312c9a8: token invalidation now requires a confirmed sender mismatch, mismatch logging uses the actionable exception message, and the string-valued manifest flag is covered through PushRegistratorFCM with a real Bundle. |


Description
One Line Summary
Improves Firebase Installation ID configuration diagnostics, tests, and integration documentation.
Details
Motivation
Firebase Installation ID setup failures were reduced to a generic FCM error, leaving developers without actionable remediation and an empty push token.
Scope
register(), sender mismatch, minification, and registration failures.Testing
Unit testing
Added coverage for missing default FirebaseApp, unavailable register API, sender mismatch, registration and Installation ID retrieval failures, Firebase manifest-flag semantics, preserved IOExceptions, remediation messages, and push registration status handling.
Manual testing
Validated the demo merged manifest. Device testing was not performed.
Affected code checklist
Checklist
Overview
Testing
Final pass