Retire the onboarding auto-finish heuristic in BaseBrowserFragment.observeTabSource()
Categories
(Firefox for Android :: Onboarding, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox158 | --- | verified |
People
(Reporter: towhite, Assigned: towhite)
References
Details
(Keywords: good-next-bug, Whiteboard: [fxdroid] [android-activation-trust] [good-next-bug])
Attachments
(1 external file)
BaseBrowserFragment.observeTabSource() was added in 2020 for
mozilla-mobile/fenix#16353, when onboarding consisted of
inline cards displayed over an otherwise usable home/browser UI, with no explicit completion action. It treats
loading a qualifying page as an implicit signal that the user has completed onboarding and calls
FenixOnboarding.finish(). Redirects, tabs from SessionState.Source.External, and two hardcoded URLs in
onboardingLinksList are excluded.
Onboarding now uses OnboardingFragment, a full-screen flow gated by HomeActivity through
Settings.shouldShowOnboarding(), with an explicit completion step that also records
Settings.onboardingCompletedTimestamp. Users must not be able to bypass onboarding: it should only be marked
complete through that explicit step, and opening a page must not complete or dismiss the flow.
Under the current architecture, a user who has not completed onboarding can only reach BaseBrowserFragment
through the exceptions allowed by Intent.isAllowedDuringOnboardingIntent()—sandboxed custom tabs and the
sync-auth custom tab—or through a genuinely external tab, which is already excluded from triggering finish().
Any remaining page load that triggers this heuristic is therefore a false positive. The sibling bug covering the
onboardingLinksList allow-list gap demonstrates this: an onboarding card’s own “Learn more” or Terms of Service
link can prematurely end onboarding when its URL is not included in the hardcoded allow-list.
This heuristic is also the sole documented live path for creating “cohort 4” in
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/onboarding/README.md: users who are marked as onboarded
(FenixOnboarding.userHasBeenOnboarded() returns true) without an onboardingCompletedTimestamp.
migratePreContinuousOnboardingUserIfNeeded(), introduced in bug 2071254, mitigates the resulting state but does
not address its cause.
Remove observeTabSource() and its call site from BaseBrowserFragment after confirming that no other flow relies
on page loads implicitly completing onboarding. This should prevent new cohort-4 installations. It does not repair
existing installations, which remain covered by bug 2071254; keep the migration workaround in place until this
change has had sufficient bake time.
QA steps
Reproduce in Nightly 157
- Install Firefox Nightly 157 (suggest using TryFox).
- Open Firefox and accept the Terms of Service, but do not complete the remaining onboarding steps.
- Close Firefox by swiping it away from the recent apps screen.
- Long-press the Firefox app icon, select Widgets, and add the Firefox search widget to the home screen.
- Tap the widget’s voice-search button and perform any search.
- Close and reopen Firefox normally.
Expected: Initial onboarding does not reappear, confirming the bypass.
Verify the fix in Nightly 158
- Uninstall Firefox to clear the Nightly 157 app data.
- Install Firefox Nightly 158 using TryFox.
- Repeat the steps above.
Expected: Initial onboarding reappears at the first incomplete step, confirming that opening a page through the
widget did not mark onboarding as complete.
Updated•2 months ago
|
Updated•2 months ago
|
Comment 3•2 months ago
|
||
| bugherder | ||
Comment 4•2 months ago
|
||
Verified as fixed on the Firefox for Android Nightly 158.0a1 from 9/23 using a Samsung Galaxy Z Fold 4 (Android 16), and a Motorola Moto G30 (Android 13).
Description
•