Home opens with a delay when pairing from the onboarding pairing card
Categories
(Firefox for Android :: Accounts and Sync, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: corentin, Assigned: corentin)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxdroid][android-activation-trust])
Attachments
(1 external file, 1 obsolete file)
When the onboarding pairing sync card is the last onboarding page, selecting "Scan pairing code" opens the PairFragmentand also calls scrollToNextPageOrDismiss(). This runs OnboardingFragment.onFinish while the scanner is still open and pairing is not complete. The navigation to home triggered in this method is skipped because PairFragment is the current destination. At that point the onboarding is marked as complete, and so does telemetry.
After pairing using the scanner, the user is brought back to the onboarding pairing card for a short time. The app navigates to the home screen after 1 or 2 seconds, once the account is connected and scrollToNextCardFromSignIn calls OnboardingFragment.onFinish again. As a result OnboardingFragment.onFinish runs twice and the related event is recorded twice.
Updated•6 days ago
|
Comment 1•5 days ago
|
||
(via GitHub webhook, authenticated as shared-secret)
| Assignee | ||
Updated•5 days ago
|
| Assignee | ||
Comment 2•2 days ago
|
||
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.
Updated•2 days ago
|
Comment 4•2 days ago
|
||
| bugherder | ||
Description
•