Repository navigation
Bug 2095146 - Advance onboarding sync cards once the account is authenticated - #459
corentinbect wants to merge 1 commit into
Conversation
|
No new issues detected. This pull request is 🆗 |
1 similar comment
|
No new issues detected. This pull request is 🆗 |
1b01a9e to
5048469
Compare
|
No new issues detected. This pull request is 🆗 |
1 similar comment
|
No new issues detected. This pull request is 🆗 |
…nticated Selecting "Sign in via email" on the onboarding pairing sync card started the authentication and also called `scrollToNextPageOrDismiss()` immediately. Since this was the last page of the onboarding, the onboarding completed and the homepage was displayed for a short period before the sign in page opens. The email button no longer advances the onboarding. Instead, the signed in `LaunchedEffect` in `OnboardingScreen` advances only when the account is authenticated. That effect used to observe `SyncState.account`, which is only sets once the profile is returned from the server. Bug 2031498 changed when the authenticated state is dispatched: `AccountState.Authenticated` used to be dispatched with the account after the profile request. It is now dispatched before this network call. Observing `AccountState.Authenticated` instead navigates the user to the homepage as soon as authentication completes, removing a delay after every onboarding sync call coming from the profile fetch. Because the signed in state is also read when signing in through the old sign in card and the new pairing card, the `OnboardingSyncFlowResult` added in bug 2092151 and bug 2092623 is no longer needed and has been removed. As a result, scanning a QR code now advances the onboarding once the authentication completes, rather than as soon as the QR code is scanned.
5048469 to
ce104e6
Compare
|
No new issues detected. This pull request is 🆗 |
1 similar comment
|
No new issues detected. This pull request is 🆗 |
…nticated r=twhite Selecting "Sign in via email" on the onboarding pairing sync card started the authentication and also called `scrollToNextPageOrDismiss()` immediately. Since this was the last page of the onboarding, the onboarding completed and the homepage was displayed for a short period before the sign in page opens. The email button no longer advances the onboarding. Instead, the signed in `LaunchedEffect` in `OnboardingScreen` advances only when the account is authenticated. That effect used to observe `SyncState.account`, which is only sets once the profile is returned from the server. Bug 2031498 changed when the authenticated state is dispatched: `AccountState.Authenticated` used to be dispatched with the account after the profile request. It is now dispatched before this network call. Observing `AccountState.Authenticated` instead navigates the user to the homepage as soon as authentication completes, removing a delay after every onboarding sync call coming from the profile fetch. Because the signed in state is also read when signing in through the old sign in card and the new pairing card, the `OnboardingSyncFlowResult` added in bug 2092151 and bug 2092623 is no longer needed and has been removed. As a result, scanning a QR code now advances the onboarding once the authentication completes, rather than as soon as the QR code is scanned. Pull request: #459
|
Pull request closed by commit 225e2b6 |
titooan
left a comment
There was a problem hiding this comment.
Looks good to me, I've just added a few very nit comments.
| scrollToNextPageOrDismiss: () -> Unit, | ||
| ) { | ||
| LaunchedEffect(isSignedIn) { | ||
| if (scrollToNextCardFromSignIn(pagesToDisplay, pagerState.currentPage, isSignedIn)) { |
There was a problem hiding this comment.
should we rename scrollToNextCardFromSignIn into something like shouldScrollToNextCardFromSignIn to make it clearer that this is a check and not an "action"?
|
|
||
| return scrollToNextCard | ||
| LaunchedEffect(isSetToDefault) { | ||
| if (scrollToNextCardFromSetToDefault(pagesToDisplay, pagerState.currentPage, isSetToDefault)) { |
There was a problem hiding this comment.
Same question here, should scrollToNextCardFromSetToDefault be renamed into shouldScrollToNextCardFromSetToDefault?
| OnboardingSyncFlowResult.setCompleted(findNavController()) | ||
| } | ||
| if ( | ||
| pairWithEmailStarted || requireComponents.backgroundServices.accountManager.authenticatedAccount() != null |
There was a problem hiding this comment.
nit: having val isAuthenticated = requireComponents.backgroundServices.accountManager.authenticatedAccount() != null was maybe still beneficial for reading the code, even though it's not used multiple times?
…nticated a=dmeehan Selecting "Sign in via email" on the onboarding pairing sync card started the authentication and also called `scrollToNextPageOrDismiss()` immediately. Since this was the last page of the onboarding, the onboarding completed and the homepage was displayed for a short period before the sign in page opens. The email button no longer advances the onboarding. Instead, the signed in `LaunchedEffect` in `OnboardingScreen` advances only when the account is authenticated. That effect used to observe `SyncState.account`, which is only sets once the profile is returned from the server. Bug 2031498 changed when the authenticated state is dispatched: `AccountState.Authenticated` used to be dispatched with the account after the profile request. It is now dispatched before this network call. Observing `AccountState.Authenticated` instead navigates the user to the homepage as soon as authentication completes, removing a delay after every onboarding sync call coming from the profile fetch. Because the signed in state is also read when signing in through the old sign in card and the new pairing card, the `OnboardingSyncFlowResult` added in bug 2092151 and bug 2092623 is no longer needed and has been removed. As a result, scanning a QR code now advances the onboarding once the authentication completes, rather than as soon as the QR code is scanned. Pull request: #459 Differential Revision: https://phabricator.services.mozilla.com/D345784
Selecting "Sign in via email" on the onboarding pairing sync card started the authentication and also called
scrollToNextPageOrDismiss()immediately. Since this was the last page of the onboarding, the onboarding completed and the homepage was displayed for a short period before the sign in page opens.The email button no longer advances the onboarding. Instead, the signed in
LaunchedEffectinOnboardingScreenadvances only when the account is authenticated.That effect used to observe
SyncState.account, which is only sets once the profile is returned from the server. Bug 2031498 changed when the authenticated state is dispatched:AccountState.Authenticatedused to be dispatched with the account after the profile request. It is now dispatched before this network call. ObservingAccountState.Authenticatedinstead navigates the user to the homepage as soon as authentication completes, removing a delay after every onboarding sync call coming from the profile fetch.Because the signed in state is also read when signing in through the old sign in card and the new pairing card, the
OnboardingSyncFlowResultadded in bug 2092151 and bug 2092623 is no longer needed and has been removed. As a result, scanning a QR code now advances the onboarding once the authentication completes, rather than as soon as the QR code is scanned.Lando: link
Bugzilla: bug 2095146
🚫 This pull request has 1 blocker.