Skip to content

fix(auth): fix "Already resumed" crash in phone auth SMS auto-verification - #2447

Draft
demolaf wants to merge 2 commits into
version-10.0.0-beta04from
fix/phone-auth-already-resumed
Draft

fix(auth): fix "Already resumed" crash in phone auth SMS auto-verification#2447
demolaf wants to merge 2 commits into
version-10.0.0-beta04from
fix/phone-auth-already-resumed

Conversation

@demolaf

@demolaf demolaf commented Aug 13, 2026

Copy link
Copy Markdown
Member

Closes #2446

  • DefaultVerifier.verifyPhoneNumber resumed the same suspendCoroutine from all three Firebase phone-auth callbacks; a second callback (e.g. onCodeSent then SMS auto-retrieval's onVerificationCompleted) threw IllegalStateException: Already resumed on the main thread, uncatchable, fatal.
  • Guarded with a single AtomicBoolean latch shared across all three callbacks — first callback wins, later ones are dropped and logged instead of throwing. Switched to suspendCancellableCoroutine.

@demolaf
demolaf changed the base branch from master to version-10.0.0-beta04 August 13, 2026 14:29

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request expands the demo application to showcase Firebase Database, Firestore, and Storage modules alongside the existing Auth module, introducing new demo activities and paging adapters. It also refactors the Auth module's state management by introducing AuthState.Aborted to distinguish full-flow cancellations from operation-level cancellations (AuthState.Cancelled), and adds an isNotification property to prevent transient states from leaking across screen recreations. Additionally, it resolves a continuation resumption crash in phone verification, fixes a dialog de-duplication bug in TopLevelDialogController, and enhances security by enabling touch filtering when obscured. The reviewer suggested broadening the documentation for the identifier parameter in AuthMethodPicker to include phone numbers as well as email addresses.

I am having trouble creating individual review comments. Click here to see my feedback.

auth/src/main/java/com/firebase/ui/auth/ui/method_picker/AuthMethodPicker.kt (227)

medium

The documentation for the identifier parameter has become too restrictive. The SignInPreferenceManager can store either an email address or a phone number. This comment should be updated to reflect that to avoid confusion for developers using this component.

 * @param identifier The user identifier (email or phone number)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phone Auth crashes with "Already resumed" in DefaultVerifier.onVerificationCompleted

1 participant