fix(auth): stop showing error dialog when Google sign-in is cancelled - #2427
Draft
demolaf wants to merge 1 commit into
Draft
fix(auth): stop showing error dialog when Google sign-in is cancelled#2427demolaf wants to merge 1 commit into
demolaf wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds handling for GetCredentialCancellationException when a user dismisses the Credential Manager sheet during Google Sign-In, updating the authentication state to AuthState.Cancelled without throwing an exception. It also changes the visibility of getRecoveryMessage, getRecoveryActionText, and isRecoverable in ErrorRecoveryDialog.kt from private to internal, enabling direct testing and the removal of redundant helper methods in ErrorRecoveryDialogLogicTest.kt. There are no review comments, and I have no feedback to provide.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2422.
Cancelling the Google sign-in Credential Manager sheet showed an "Authentication Error" dialog with the raw
GetCredentialCancellationExceptionmessage ("User cancelled the selector") as the button text, instead of returning silently viaAuthState.Cancelled.signInWithGoogleonly caughtkotlinx.coroutines.CancellationException, not the actual exception Credential Manager throws on dismissal, so it fell through to the generic error path.GoogleAuthProvider+FirebaseAuthUI.kt: catchesGetCredentialCancellationExceptionexplicitly and updatesAuthState.Cancelledwithout rethrowing, so the sign-in flow returns to the picker silently andonSignInCancelledfires.ErrorRecoveryDialog.kt:getRecoveryActionTextno longer uses the raw exception message as the button label forAuthCancelledException.Added a test covering the Credential Manager cancellation path, and fixed
ErrorRecoveryDialogLogicTestto exercise the real (now-internal) dialog logic functions instead of a stale duplicate that had drifted from the actual code.