Skip to content

Bug 2095146 - Advance onboarding sync cards once the account is authenticated - #459

Closed
corentinbect wants to merge 1 commit into
mozilla-firefox:autolandfrom
corentinbect:bug2095146
Closed

corentinbect wants to merge 1 commit into
mozilla-firefox:autolandfrom
corentinbect:bug2095146

Conversation

@corentinbect

@corentinbect corentinbect commented Nov 19, 2026 •

Copy link
Copy Markdown

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.


Lando: link
Bugzilla: bug 2095146

🚫 This pull request has 1 blocker.

@lando-web
lando-web Bot requested a review from a team November 19, 2026 16:42
@mozilla-code-review

Copy link
Copy Markdown

No new issues detected. This pull request is 🆗

1 similar comment
@mozilla-code-review

Copy link
Copy Markdown

No new issues detected. This pull request is 🆗

@mozilla-code-review

Copy link
Copy Markdown

No new issues detected. This pull request is 🆗

1 similar comment
@mozilla-code-review

Copy link
Copy Markdown

No new issues detected. This pull request is 🆗

@corentinbect corentinbect left a comment •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

…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.
@mozilla-code-review

Copy link
Copy Markdown

No new issues detected. This pull request is 🆗

1 similar comment
@mozilla-code-review

Copy link
Copy Markdown

No new issues detected. This pull request is 🆗

@t-p-white t-p-white left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm 🚀

@lando-web
lando-web Bot requested a review from a team November 24, 2026 11:28
lando-worker Bot pushed a commit that referenced this pull request Nov 24, 2026
…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
@lando-worker

lando-worker Bot commented Nov 24, 2026

Copy link
Copy Markdown

Pull request closed by commit 225e2b6

@lando-worker lando-worker Bot closed this Nov 24, 2026

@titooan titooan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me, I've just added a few very nit comments.

scrollToNextPageOrDismiss: () -> Unit,
) {
LaunchedEffect(isSignedIn) {
if (scrollToNextCardFromSignIn(pagesToDisplay, pagerState.currentPage, isSignedIn)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same question here, should scrollToNextCardFromSetToDefault be renamed into shouldScrollToNextCardFromSetToDefault?

OnboardingSyncFlowResult.setCompleted(findNavController())
}
if (
pairWithEmailStarted || requireComponents.backgroundServices.accountManager.authenticatedAccount() != null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

lando-worker Bot pushed a commit that referenced this pull request Nov 24, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants