Skip to content
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

Rewrite email logic with new architecture #1214

Merged
merged 9 commits into from
Apr 2, 2018
Merged

Rewrite email logic with new architecture #1214

merged 9 commits into from
Apr 2, 2018

Conversation

SUPERCILEX
Copy link
Collaborator

Built on top of #1213

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
@SUPERCILEX SUPERCILEX requested a review from samtstern as a code owner March 26, 2018 00:17
@samtstern samtstern added this to the 3.3.1 milestone Mar 27, 2018
@SUPERCILEX SUPERCILEX changed the base branch from version-3.3.0-dev to master March 28, 2018 21:49
@samtstern samtstern changed the base branch from master to version-3.3.1-dev March 29, 2018 15:28
// Email address is malformed
mEmailInput.setError(getString(R.string.fui_invalid_email_address));
} else if (e instanceof FirebaseAuthUserCollisionException) {
// Collision with existing user email, it should be very hard for
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we changing our assumption from "very hard to get here" to "impossible to get here"? Fine with me, just confirming.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh nevermind, I see the StartWelcomeBackFlow in the ViewModel

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yup, moved that logic there.

}

private void validateAndSignIn(final String email, final String password) {
private void validateAndSignIn(String password) {
// Check for null or empty password
if (TextUtils.isEmpty(password)) {
mPasswordLayout.setError(getString(R.string.fui_required_field));
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we return if the password is empty?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We do, it looks like the diff hides it 😉

// Collision with existing user email, it should be very hard for
// the user to even get to this error due to CheckEmailFragment.
ProviderUtils.fetchTopProvider(getAuth(), email)
.addOnSuccessListener(new StartWelcomeBackFlow(email));
Copy link
Contributor

Choose a reason for hiding this comment

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

What about when this call fails too? Feels like we could get a case where the Resource never gets to a final state.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Whoops, yeah.

@SUPERCILEX SUPERCILEX changed the title Remove unused email strings Rewrite email logic with new architecture Apr 2, 2018
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
@samtstern samtstern merged commit 9d954e4 into firebase:version-3.3.1-dev Apr 2, 2018
@SUPERCILEX SUPERCILEX deleted the unused branch April 2, 2018 17:24
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