Skip to content

Fix startLogin being called on every configuration change with only one provider enabled #552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2017

Conversation

SUPERCILEX
Copy link
Collaborator

Signed-off-by: Alex Saveau <[email protected]>
@SUPERCILEX SUPERCILEX changed the title Fix race condition with only one provider enabled Fix startLogin being called on every configuration change with only one provider enabled Jan 27, 2017
@samtstern
Copy link
Contributor

LGTM, but can you quickly explain how to reproduce the intial bug? I didn't really understand the report in #549

@SUPERCILEX
Copy link
Collaborator Author

@samtstern Of course!

Using a single provider with or without smart lock eventually calls redirectToIdpSignIn -> an instance of IdpSignInContainer is created with setRetainInstance(false) (by default) -> on every screen rotation, startLogin gets called. The reason we don't see this bug anywhere else in FirebaseUI is because stuff like AuthMethodPickerActivity doesn't use IdpSignInContainer. IdpSignInContainer's only usage is for SignInDelegate.

@SUPERCILEX
Copy link
Collaborator Author

@samtstern I just realized you might have been asking for a non-technical explanation for which the answer would be: start login with a single provider -> get to the provider's login section (eg not the smart lock thing) -> rotate the screen.

@samtstern
Copy link
Contributor

@SUPERCILEX yep the second one was what I wanted, confirmed the bug.

@samtstern samtstern merged commit 4bc45af into firebase:version-1.2.0-dev Jan 30, 2017
@SUPERCILEX SUPERCILEX deleted the rotation-bug branch January 30, 2017 20:58
@samtstern
Copy link
Contributor

@SUPERCILEX https://travis-ci.org/firebase/FirebaseUI-Android looks like the build is failing with a lint error here but I don't get any on my machine. Can you reproduce?

@SUPERCILEX
Copy link
Collaborator Author

@samtstern Travis says it's because support lib 25.1.1 came out https://developer.android.com/topic/libraries/support-library/revisions.html#25-1-1

I'll create an update PR later today since it's just bug fixes (and I'll also disable GradleDependency to make our builds less flaky like in #542).

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.

2 participants