Uh oh!
There was an error while loading. Please reload this page.
fix(e2e): fix flaky Google credential-linking test - #2455
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the authentication flow lifecycle in FirebaseUI, introducing a distinct AuthState.Aborted state to separate flow-level aborts from operation-level cancellations. It also transitions phone verification to a Flow-based API to prevent dropped callbacks and fixes a bug where the TopLevelDialogController was prematurely recreated. The review feedback suggests restoring the 'Sign Up' button in a disabled state (rather than hiding it) when new registrations are disabled, and localizing the hardcoded phone verification cooldown error message using string resources.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…edential linking tests
00a68b1 to
7036d24Compare
russellwheatley
left a comment
There was a problem hiding this comment.
LGTM. The providerData wait is the right postcondition here, so these linking tests can't pass on the leftover email-sign-in Success.
Uh oh!
There was an error while loading. Please reload this page.
isCredentialLinkingEnabled links Google to existing email user preserving UIDflaked once on CI (run 32249308037, PR #2449) with anAssertionErrorWithFacts, then passed clean on retry with no code changes.Root cause:
currentAuthState is AuthState.Successis already true from the initial email/password sign-in, and stays true through the Google-link step becauseAuthState.Success.equalscompares the wrappedFirebaseUserby reference — Firebase mutates the samecurrentUserinstance in place during linking rather than replacing it. SowaitUntil { currentAuthState is AuthState.Success }can pass on the stale pre-link value beforelinkWithCredential()+ profile merge finish, and the assertions occasionally readproviderDatamid-link.Fix: both linking
waitUntilchecks (Google and phone) now also require the linked provider to actually be present onproviderData, tying the wait to the real postcondition instead of racing onAuthStateidentity.Verified with 5+ repeated
./gradlew e2eTest --tests CredentialLinkingScreenTestruns plus the fulle2eTestsuite.