Closed Bug 2014321 Opened 7 months ago Closed 6 months ago

Make FxA Auth flow reliably wait before switching to Smart Window

Categories

(Core :: Machine Learning: Frontend, defect, P1)

defect

Tracking

()

VERIFIED FIXED
149 Branch
Tracking Status
firefox-esr140 --- disabled
firefox147 --- disabled
firefox148 --- disabled
firefox149 --- verified

People

(Reporter: pdahiya, Assigned: markh)

References

(Blocks 1 open bug)

Details

(Whiteboard: [genai][onboarding][fxsync-])

Attachments

(1 file)

Scope of this bug is to ensure user completes FxA Auth flow before switching to Smart Window

STR

  1. Start Nightly and set pref browser.smartwindow.enabled as true
  2. Sign into Sync
  3. Click Switch to Smart Window and wait on Sign In Screen
  4. Click the account toolbar button while you're on the sign in screen to trigger FxA UI State update

Actual Result
User is taken to Smart Window without completing Smart Window Auth flow

Expected Result
User should enter credential and complete auth flow before switch

Issue here is Auth flow relies on UIState to check if a user is signed in before setting tos.hasConsent pref and redirecting to SmartWindow. UIState is FxA browser state and update can fire for other reasons outside of SmartWindow auth flow signin complete making it unreliable.

https://searchfox.org/firefox-main/rev/c206271d981e72dac0fdd91625b2c0709129a7d6/toolkit/components/messaging-system/lib/SpecialMessageActions.sys.mjs#394-398,404-405,438

https://searchfox.org/firefox-main/rev/c206271d981e72dac0fdd91625b2c0709129a7d6/browser/components/aiwindow/ui/modules/AIWindowAccountAuth.sys.mjs#85

Priority: -- → P1
Whiteboard: [genai][onboarding]
Blocks: 1994503
Depends on: 2007177
See Also: → 2014056

Smartwindow in particular wants to direct and already signed in
user to the login page for the "smartwindow" service. But an
already signed in user will in some cases cause fxaSignInFlow
to resolve before the flow is complete.

The other (unlikely but possible) scenario might be if 2
logins were active at the same time - eg, smartwindow is
logging in, and the user paused that and started a relay
flow login or similar.

I'm not sure what ipprotection does in the case of already signed
in users, but this patch should work in all cases.

Assignee: nobody → markh
Status: NEW → ASSIGNED
Whiteboard: [genai][onboarding] → [genai][onboarding][fxsync-]
Pushed by mhammond@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/6702d603672f https://hg.mozilla.org/integration/autoland/rev/7c26cc9621bf ipprotection/smartwindow logins should only complete when the requested service is connected. r=skhamis,ip-protection-reviewers,pdahiya,fchasen
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch
Blocks: 2015449
Duplicate of this bug: 2015449

Verified as fixed in our latest Nightly 149.0a1 (2026-02-09)

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-ver-done-c149/b148]
QA Contact: rdoghi
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: