Conversation
Generated by 🚫 dangerJS |
| public void onGoogleSignupFinished(String name, String email, String photoUrl, String username) { | ||
| AnalyticsTracker.track(AnalyticsTracker.Stat.SIGNUP_SOCIAL_SUCCESS); | ||
|
|
||
| mLoginAnalyticsListener.trackAnalyticsSignIn(false); |
There was a problem hiding this comment.
Shouldn't this be trackAnalyticsSignIn(true)? I believe the flag is meant to identify self-hosted vs WP.com logins, and WP.com signups should count as the latter.
There was a problem hiding this comment.
(The same would apply to the change in WPMainActivity.)
There was a problem hiding this comment.
you're right of course! good catch
|
@planarvoid aside from my comment this looks good to me. Definitely 👍 on the DI refactor. It's probably worth having someone who worked on signup take a look as well though as I agree the flow is fairly complex. @theck13 could you give this a once-over? |
theck13
left a comment
There was a problem hiding this comment.
I agree with @aforcier that I believe both mLoginAnalyticsListener.trackAnalyticsSignIn(false); statements should be mLoginAnalyticsListener.trackAnalyticsSignIn(true);.
I'm not sure, but we might want to call mLoginAnalyticsListener.trackAnalyticsSignIn(true); immediately after LoginAnalyticsListener.trackCreatedAccount(username, email) instances. @aerych, can you confirm that's what is intended with the issue?
Basically, once we've obtained the user's bearer token, we want to bump the signed in stat. If that happens immediately after we bump account created, then yes. |
|
@theck13 You're definitely right with the |
|
👍 to the move to the For the Where it currently is, it triggers when we extract the token from the magic link. This matches the criterion of "once we've obtained the user's bearer token" for dispatching the tracks event, but at this point we wouldn't know if the token was invalid for any reason. If we move it to where
My instinct would be to leave it where it is, as some of those things can go wrong and succeed later after retrying without needing a new token (so I would count the user as already 'logged in'). Since ultimately we're trying to be consistent with iOS though, @aerych could you tell us at which point this event is fired on that platform? Is it right when the token is obtained from the magic link or sometime later? |
|
Note: I'm taking this PR over for @planarvoid since he's going on vacation. |
|
I'm bumping this to If you'd like it to be released as part of |
Its actually a bit later. (My earlier comment wasn't terribly accurate.) The tl;dr is we bump the signed in stat once account information has been synced. This is true for both sign up and log in flows. Here are the relevant code points:
|
|
@aerych thanks for the walkthrough on that! Then, given that: I propose we move the call to WDYT @theck13 ? |
|
Just for clarification, we would only move the |
This is more consistent with when iOS dispatches a signed in event during e-mail sign up.
|
Thank you, everyone, for wrangling this! |
Fixes #10230
I've tried to identify the places where we're sure we have a token during the signup. I think there are 2 things that could happen. One is a successful Google signup and the other one is going through the magic link and getting the token there. I've covered these two use cases but there might be something wrong because the flow is really hard to follow.
As part of this PR I did a very small refactoring where I moved the
AccountStoreandSiteStoreto the constructor of theLoginAnalyticsModuleinstead of passing it as parameters. I think that's the correct approach since the module is injected.Let me know if this approach makes sense!
To test:
Update release notes:
RELEASE-NOTES.txt.