fix(auth): fix "Already resumed" crash in phone auth SMS auto-verification - #2447
fix(auth): fix "Already resumed" crash in phone auth SMS auto-verification#2447demolaf wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
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)
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)
Closes #2446
DefaultVerifier.verifyPhoneNumberresumed the samesuspendCoroutinefrom all three Firebase phone-auth callbacks; a second callback (e.g.onCodeSentthen SMS auto-retrieval'sonVerificationCompleted) threwIllegalStateException: Already resumedon the main thread, uncatchable, fatal.AtomicBooleanlatch shared across all three callbacks — first callback wins, later ones are dropped and logged instead of throwing. Switched tosuspendCancellableCoroutine.