GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Adds continue as guest by lsirac · Pull Request #1375 · firebase/FirebaseUI-Android

Conversation

@lsirac

@lsirac lsirac commented Jun 26, 2018 •
edited by samtstern
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

See #900

image

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lsirac
Adds continue as guest
0701683
@lsirac
lsirac requested a review from samtstern as a code owner June 26, 2018 21:54
@lsirac lsirac changed the title Adds continue as guest functionality Adds continue as guest Jun 26, 2018
@samtstern samtstern mentioned this pull request Jun 26, 2018
Auth - add anonymous provider as login #900
Closed
@samtstern samtstern added this to the 4.2.0 milestone Jun 26, 2018
@lsirac
Updated documentation
9665e12
samtstern
samtstern reviewed Jun 26, 2018
View reviewed changes

@samtstern samtstern left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Mostly LGTM! Just a few comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/data/remote/AnonymousSignInHandler.java Outdated
.build();
}

private void showTopProgressBar() {

@samtstern samtstern Jun 26, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I think we should either rename this to setLoading() or just inline it at all call sites. The handlers should not have UI logic, it's up to the observer to decide how to display (or ignore) progress events. Top progress bar is our current favorite pattern but it was a dialog before that and could easily change again.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lsirac lsirac Jun 26, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/data/remote/AnonymousSignInHandler.java Outdated

}

public IdpResponse getResponse(boolean isNewUser) {

@samtstern samtstern Jun 26, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Is this used in more than one place? Could we just inline it? Also does it need to be public?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lsirac lsirac Jun 26, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Definitely should be private.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/data/remote/AnonymousSignInHandler.java
setResult(Resource.<IdpResponse>forLoading());
}

private FirebaseAuth getAuth() {

@samtstern samtstern Jun 26, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I think you can get this from AuthUI right? The other handlers don't duplicate this logic afaik.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lsirac lsirac Jun 26, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Other handlers extend from AuthViewModelBase. Added a todo for this.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/data/remote/AnonymousSignInHandler.java Outdated
}

@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {}

@samtstern samtstern Jun 26, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

nit: move this up with the other @Override methods.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lsirac lsirac Jun 26, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread build.gradle.kts Outdated
"NewerVersionAvailable", "GradleDependency", // For reproducible builds
"SelectableText", "SyntheticAccessor" // We almost never care about this
"SelectableText", "SyntheticAccessor", // We almost never care about this
"InvalidVectorPath" // false positive for fui_ic_anonymous_white_24dp

@samtstern samtstern Jun 26, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I think we may just want to add a single exception for this to the lint baseline rather than ignoring all InvalidVectorPath errors since they could be serious in the future.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lsirac lsirac Jun 26, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lsirac
Changes based on code review
be3ec5b
@lsirac
lsirac requested a review from SUPERCILEX June 26, 2018 23:38
samtstern
samtstern approved these changes Jun 26, 2018
View reviewed changes
SUPERCILEX
SUPERCILEX reviewed Jun 27, 2018
View reviewed changes

@SUPERCILEX SUPERCILEX left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good, mostly have some comments about the provider handler stuff.

PS: @samtstern why are we deciding to show UI? I still feel like devs should sign in anonymously on boot as opposed to letting users think they signed in and then lose all their data when they switch devices.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/AuthUI.java Outdated
/**
* {@link IdpConfig} builder for the Anonymous provider.
*/

@SUPERCILEX SUPERCILEX Jun 26, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Nit: remove line

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lsirac lsirac Jun 27, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/AuthUI.java Outdated

public class AnonymousAuthProvider {
public static final String PROVIDER_ID = "anonymous";
}

@SUPERCILEX SUPERCILEX Jun 26, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Not quite sure I see why we need this... Can't we just use AnonymousAuthProvider.PROVIDER_ID?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lsirac lsirac Jun 27, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Where is this AnonymousAuthProvider that you speak of? 😄

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@SUPERCILEX SUPERCILEX Jun 27, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

😆❤️

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@SUPERCILEX SUPERCILEX Jun 27, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Oh lol, you named it so well I thought you were joking. 😊 Anyway... since Firebase doesn't have a built-in AnonymousAuthProvider, shouldn't the FirebaseAuthProvider essentially be the same thing? @samtstern Am I mixing it up or is FirebaseAuthProvider intended to represent anon auth?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@samtstern samtstern Jun 27, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

No idea, @lsirac might know better than I do!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lsirac lsirac Jun 27, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't think FirebaseAuthProvider is intended to represent anon auth. Every signed in user has a "firebase" provider.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@SUPERCILEX SUPERCILEX Jun 27, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Gotya, then I think we should stick to a field in AuthUI directly. We used to have stuff like this:

-    /**
-     * Provider identifier for email and password credentials, for use with {@link
-     * SignInIntentBuilder#setAvailableProviders(List)}.
-     */
-    public static final String EMAIL_PROVIDER = EmailAuthProvider.PROVIDER_ID;

So we could do ANONYMOUS_PROVIDER. Also, does it need to be publicly accessible? I think we could mark it with @RestrictTo.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lsirac lsirac Jun 27, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

So we'd do AuthUI.ANONYMOUS_PROVIDER instead of AuthUI.AnonymousAuthProvider.PROVIDER_ID? and yeah we can mark it with @RestrictTo

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@SUPERCILEX SUPERCILEX Jun 27, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yup! 😊

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/res/layout/fui_provider_button_anonymous.xml Outdated
android:id="@+id/anonymous_button"
style="@style/FirebaseUI.Button.AccountChooser.AnonymousButton"
android:text="@string/fui_sign_in_anonymously">
</com.firebase.ui.auth.util.ui.SupportVectorDrawablesButton> No newline at end of file

@SUPERCILEX SUPERCILEX Jun 26, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Nit: unnecessary tag (could just be />)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lsirac lsirac Jun 27, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread library/quality/lint-baseline.xml Outdated
id="InvalidVectorPath"
message="Use 0.94 instead of .94 to avoid crashes on some devices">
<location file="src/main/res/drawable/fui_ic_anonymous_white_24dp.xml"></location>
</issue>

@SUPERCILEX SUPERCILEX Jun 26, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't think we want this to be in our baseline since we're purposefully ignoring it. The baseline is meant to be a baseline (for lack of a better word 😆) that you're trying to slowly shrink over time.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@samtstern samtstern Jun 27, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Do you know how to purposefully ignore a warning like this? Can we add something in the vector XML itself?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@SUPERCILEX SUPERCILEX Jun 27, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yup, should be the same tools:ignore="InvalidVectorPath" we all know and love. 😆

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lsirac lsirac Jun 27, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/data/remote/AnonymousSignInHandler.java Outdated
.build();
}

// TODO: Change ProviderSignInBase to extend from AuthViewModelBase

@SUPERCILEX SUPERCILEX Jun 26, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

ProviderSignInBase classes are meant to only retrieve remote provider data, hence making it difficult to get an auth instance as you've noticed. It was also supposed to be UI focused which is why there's a bunch of activity related stuff.

I feel like we should make this class be a bare bones middle man that sends an IdpResponse to an AnonymousProviderResponseHandler with the auth stuff. @samtstern What do you think?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@samtstern samtstern Jun 27, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@SUPERCILEX in this version which class actually would call signInAnonymously?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@SUPERCILEX SUPERCILEX Jun 27, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

signInAnonymously would be called in the AnonymousProviderResponseHandler. And AnonymousSignInHandler would be something as simple as:

// ...

@Override
public void startSignIn(@NonNull HelperActivityBase activity) {
    setResult(Resource.<IdpResponse>forSuccess(new IdpResponse.Builder(
                new User.Builder(AuthUI.AnonymousAuthProvider.PROVIDER_ID, null).build())
                .build()));
}

Not sure if that's actually better though since having AnonymousSignInHandler becomes kinda pointless. I'm just not a huge fan of doing auth stuff in a non-auth view model. 🤷‍♂️

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lsirac lsirac Jun 27, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@samtstern thoughts?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@samtstern samtstern Jun 28, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Maybe we compromise and only have the ResponseHandler but call it immediately, rather than having the useless ViewModel. I agree we shouldn't do the signing in in the non-auth view model if we can avoid it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

SUPERCILEX reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@samtstern

samtstern commented Jun 27, 2018

Copy link
Copy Markdown
Contributor

@SUPERCILEX agree, but enough devs have asked for this (across all platforms) that we just decided to give them the option. Apparently some people like the UX of the "continue as guest" button. I am not one of those people but hey, free choice!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SUPERCILEX

SUPERCILEX commented Jun 27, 2018

Copy link
Copy Markdown
Contributor

@samtstern Seems weird to me, but alrighty then! 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lsirac added 2 commits June 26, 2018 17:51
@lsirac
Changes based on Alex's suggestions
f416125
@lsirac
Small changes
ebe7650
@samtstern

samtstern commented Jun 28, 2018

Copy link
Copy Markdown
Contributor

@SUPERCILEX after talking to Leo, we think the right move is to stick with the original organization and have the anon sign-in code be part of the SignInHandler rather than a ResponseHandler.

I know this breaks your class hierarchy a bit, but I don't think adding a useless class is any better. If we just pretend that the Anonymous sign in is some IDP called "Anonymous, Incorporated" it's not hard to imagine why the Firebase Auth code belongs there.

Maybe we can find a future way to bring the two ViewModel class hierarchy trees closer together in the future?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

samtstern
samtstern approved these changes Jun 28, 2018
View reviewed changes
@samtstern

samtstern commented Jun 29, 2018

Copy link
Copy Markdown
Contributor

Ok I am going to be out all of next week so I am going to merge this now as I think it LGTM. But not opposed to future discussion on the organization if we're not all on the same page.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@samtstern
samtstern merged commit 2631d09 into version-4.2.0-dev Jun 29, 2018
@samtstern samtstern mentioned this pull request Jun 29, 2018
[Translations] Get translations for continue as guest #1382
Closed
@austinhodak

austinhodak commented Oct 9, 2018

Copy link
Copy Markdown

Not sure if this is related to this pull. When using a dark theme for the FirebaseUI using .setTheme(), the shadow underneath the anon login is still white whereas the others are the correct dark theme.

` <style name="SignInTheme" parent="Theme.AppCompat">
@color/timelineBG
@color/timelineDark
@color/md_orange_500

    <item name="colorControlNormal">@color/md_orange_500</item>
    <item name="colorControlActivated">@color/md_orange_A700</item>
    <item name="colorControlHighlight">@color/md_orange_A200</item>
    <item name="android:windowBackground">@color/timelineBG</item>
</style>`

smartselect_20181009-122203_battle buddy

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@samtstern

samtstern commented Oct 9, 2018

Copy link
Copy Markdown
Contributor

@austinhodak could you file a separate bug to track that issue? Thanks!

austinhodak reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers
@SUPERCILEX SUPERCILEX SUPERCILEX left review comments
@samtstern samtstern samtstern approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.2.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@lsirac @samtstern @SUPERCILEX @austinhodak
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.