Skip to content
This repository has been archived by the owner. It is now read-only.

User can close the FxA window in Fx for iOS before login message is sent. #4377

Closed
shane-tomlinson opened this issue Nov 8, 2016 · 10 comments
Closed
Assignees
Labels

Comments

@shane-tomlinson
Copy link
Member

@shane-tomlinson shane-tomlinson commented Nov 8, 2016

In c04980d, we added a 5 second delay after completing signup/signin before sending the login notification to Fx for iOS. We did this so that users would see some messaging that says "go check your email" before Fx for iOS took over the screen and displayed its own messaging.

This delay gives the user a window of opportunity to close the FxA window before the login message is sent. If this happens, the browser is none the wiser of the user's login and will never start syncing.

If we can detect the window is about to close, maybe in a beforeunload handler, we should send the login message immediately.

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Nov 8, 2016

I bet beforeunload is still not supported in Safari / WebKit iOS so we need some other solution

@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Nov 8, 2016

I bet beforeunload is still not supported in Safari / WebKit iOS so we need some other solution

Ugh, I forgot about that. blur like you do with event reporting?

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Nov 8, 2016

@shane-tomlinson that might also not work because blur is then you get out of Safari or switch Safari tabs, in this case the view is destroyed I assume...

@sleroux
Copy link
Member

@sleroux sleroux commented Dec 13, 2016

Just wanted to check in - is this workaround something we can do prior to Dec 22 (our tentative iOS 6.0 release date) or is it worth going the full phased route as explained in https://bugzilla.mozilla.org/show_bug.cgi?id=1289480?

@rfk
Copy link
Member

@rfk rfk commented Dec 15, 2016

is this workaround something we can do prior to Dec 22

FWIW I wouldn't count on us getting another deploy out production in that timeframe. @sleroux ping me tomorrow if you want to discuss what some other options might be.

@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Jan 24, 2017

I found out today that we can use a visibilitychange event to cause the message to be sent, but the message will only be sent if the user clicks the home button, and I imagine (though have not tested) if the user opens their email client from the notification bar.

Using visibilitychange does not help users who click Settings, if the user clicks that, no message is ever sent.

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Jan 24, 2017

from mtg:

should we change timeout for train-79?

@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Jan 25, 2017

should we change timeout for train-79?

Yes, that's one of 3 patches I'm putting together today to add on to train-79.

shane-tomlinson pushed a commit that referenced this issue Jan 25, 2017
This is only a stopgap to see if we can increase the # of users
that successfully sign in on Fx for iOS w/o changing any browser code.

issue #4377
shane-tomlinson pushed a commit that referenced this issue Jan 25, 2017
… r=@rfk

This is only a stopgap to see if we can increase the # of users
that successfully sign in on Fx for iOS w/o changing any browser code.

issue #4377
shane-tomlinson pushed a commit that referenced this issue Jan 27, 2017
The `login` message is sent after 5 seconds regardless. Also send it
on the `visibilitychange` and `blur` DOM events in case the user receives
the email and opens their email client before the event is sent.

issue #4377
shane-tomlinson pushed a commit that referenced this issue Jan 31, 2017
The `login` message is sent after 5 seconds regardless. Also send it
on the `visibilitychange` and `blur` DOM events in case the user receives
the email and opens their email client before the event is sent.

issue #4377
@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Feb 1, 2017

While testing on device, I just realized I made a bone-headed decision when adding the delay - no wonder signin success is so low on iOS. I added the delay for all accounts, not just unverified accounts. If a user is verified and does not need to go through signin confirmation, the screen just sits there for 5/10 seconds, says "working...", and then if the user hasn't given up, the message is sent the browser does the right thing. This is silly. The login message should be sent right away for verified users.

@vbudhram
Copy link
Contributor

@vbudhram vbudhram commented Feb 1, 2017

The login message should be sent right away for verified users.

Good point, I think originally when we added this, all users went through confirmation so they would always see that screen. Now, user's can potentially bypass confirmation with IP profiling. We should definitely just send the send the login message for these users since they are verified already.

shane-tomlinson pushed a commit that referenced this issue Feb 1, 2017
For verified accounts, the `login` message is sent immediately.

For unverified accounts, the `login` message is sent after the
first of 1) a 5 second timeout, or 2) a `blur` DOM event.

The `blur` DOM event is to handle the case where a user receives
their verification email and opens the email client before the timeout
has occurred.

issue #4377
shane-tomlinson pushed a commit that referenced this issue Feb 6, 2017
For verified accounts, the `login` message is sent immediately.

For unverified accounts, the `login` message is sent after the
first of 1) a 5 second timeout, or 2) a `blur` DOM event.

The `blur` DOM event is to handle the case where a user receives
their verification email and opens the email client before the timeout
has occurred.

Fx for iOS allows the user to see the "confirm your email" screen,
but never takes it away after the user verifies. Allow the poll
so that the user sees the "Signup complete!" screen after they
verify their email.

fixes #4377
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

6 participants