Skip to content

Bug 2092151 - Advance onboarding only when the sync flow started from the pairing card completes - #447

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

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

Conversation

@corentinbect

@corentinbect corentinbect commented Nov 13, 2026 •

Copy link
Copy Markdown

Selecting "Scan pairing code" on the the onboarding pairing sync card opened PairFragment and also called scrollToNextPageOrDismiss() immediately. This ran OnboardingFragment.onFinish while the scanner was still open and pairing was not complete. Onboarding was marked as complete and telemetry was recorded, but the navigation to home was skipped because PairFragment was the current destination. As soon as the account was connected, the sign in LaunchedEffect in OnboardingScreen called OnboardingFragment.onFinish another time, resulting in a duplicate event and a delayed navigation to the home screen.

This patch adds OnboardingSyncFlowResult, an object that lets sync flows started from onboarding report flow completion. The result is stored in the SavedStateHandle of the previous back stack entry so that only the destination that started the flow is notified. PairFragment reports completion when a QR code is scanned and SyncFlowCompletedEffect moves to the next page once and consumes the result.

Also OnboardingFragment.onFinish now returns early if the current destination is not the onboarding. This avoids unexpected side effects when another screen is the current destination.


Lando: link
Bugzilla: bug 2092151

⚠️ This pull request has 2 warnings.
🚫 This pull request has 1 blocker.

… the pairing card completes

Selecting "Scan pairing code" on the the onboarding pairing sync card opened `PairFragment` and also called `scrollToNextPageOrDismiss()` immediately. This ran `OnboardingFragment.onFinish` while the scanner was still open and pairing was not complete. Onboarding was marked as complete and telemetry was recorded, but the navigation to home was skipped because `PairFragment` was the current destination. As soon as the account was connected, the sign in `LaunchedEffect` in `OnboardingScreen` called `OnboardingFragment.onFinish` another time, resulting in a duplicate event and a delayed navigation to the home screen.

This patch adds `OnboardingSyncFlowResult`, an object that lets sync flows started from onboarding report flow completion. The result is stored in the `SavedStateHandle` of the previous back stack entry so that only the destination that started the flow is notified. `PairFragment` reports completion when a QR code is scanned and `SyncFlowCompletedEffect` moves to the next page once and consumes the result.

Also `OnboardingFragment.onFinish` now returns early if the current destination is not the onboarding. This avoids unexpected side effects when another screen is the current destination.
@lando-web
lando-web Bot requested a review from a team November 13, 2026 16:53
@corentinbect

Copy link
Copy Markdown
Author

Try run

@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 🆗

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant