Skip to content

fix: make Firebase initialization synchronous to prevent race condition#748

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/firebase-init-race-condition
May 20, 2026
Merged

fix: make Firebase initialization synchronous to prevent race condition#748
bmc08gt merged 1 commit into
code/cashfrom
fix/firebase-init-race-condition

Conversation

@bmc08gt
Copy link
Copy Markdown
Collaborator

@bmc08gt bmc08gt commented May 20, 2026

FirebaseInitializer was launching Firebase.initialize() on Dispatchers.IO, but UserManager accesses Firebase.messaging.token synchronously during Hilt injection in Application.onCreate(). This race causes IllegalStateException when the IO coroutine hasn't completed before injection runs.

FirebaseInitializer was launching Firebase.initialize() on Dispatchers.IO,
but UserManager accesses Firebase.messaging.token synchronously during Hilt
injection in Application.onCreate(). This race causes IllegalStateException
when the IO coroutine hasn't completed before injection runs.

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
@bmc08gt bmc08gt self-assigned this May 20, 2026
@github-actions github-actions Bot added the type: fix Bug fix label May 20, 2026
@bmc08gt bmc08gt merged commit 965f52c into code/cash May 20, 2026
3 checks passed
@bmc08gt bmc08gt deleted the fix/firebase-init-race-condition branch May 20, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant