fix(desktop): reduce browser Keychain prompts during Google import#10124
fix(desktop): reduce browser Keychain prompts during Google import#10124skanderkaroui wants to merge 4 commits into
Conversation
Select one main profile per installed browser, reject stale profiles, and require plaintext Google account or auth-cookie evidence before reading Safe Storage. Tests: ./scripts/dev-feedback.py --once swift 'BrowserGoogleSessionTests'; ./scripts/swift-test-suites.sh; OMI_LIVE_BROWSER_GATE=1 live production-gate probe with stubbed keychain loader; Swift format/lint and desktop test-quality checks. Failure-Class: none
Keep every recent Google-authenticated profile, order running browsers and preferred profiles first, and fall back to only the newest stale session when no profile was active within 30 days. Tests: ./scripts/dev-feedback.py --once swift 'BrowserGoogleSessionTests'; ./scripts/swift-test-suites.sh; Swift format lint and desktop test-quality checks. Failure-Class: none
|
Thanks for tightening this path — filtering browser/profile candidates before touching the Safe Storage key is the right direction and should reduce unnecessary Keychain prompts. One thing I’d fix before marking this ready: the new cookie prefilter still uses substring matching for Google hosts ( I did not see evidence of a malicious/supply-chain attempt in the static diff. Because this is draft, touches browser cookies/Keychain behavior, and the Desktop Swift CI is still in progress, this should still get human maintainer review before merge. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
undivisible
left a comment
There was a problem hiding this comment.
Request changes
Direction is right: stop treating every Cookies file as a Keychain invitation. Local State + Google auth-cookie evidence before Safe Storage, running-browser first, 30-day recency with newest-stale fallback — that’s how you stop the Keychain paparazzi.
Please
- Mark Ready for review only after a live multi-browser pass (Chrome + one alt, multi-profile) confirms fewer prompts and first working session still imports.
- Rebase onto current
mainand clear the red/cancelled Desktop Swift Build & Tests run. - Keep the draft until (1)+(2) — security-adjacent path, wants a clean gate.
Summary
Root cause
configsForPythontreated every Cookies file as sufficient evidence and read each browser's Safe Storage item before proving that the browser was recent or had a Google session. That surfaced unnecessary blocking macOS Keychain prompts for stale or unused browsers.User impact
Onboarding now prompts only for plausible Gmail/Calendar sources. Multiple active profiles remain available in priority order, profiles in one browser reuse the same cached Safe Storage key, and imports stop on the first working session.
Validation
./scripts/dev-feedback.py --once swift 'BrowserGoogleSessionTests'./scripts/swift-test-suites.sh(337 isolated Swift suites)desktop/macos/scripts/swift-format-wrapper.sh lint Desktop/Sources/BrowserGoogleSession.swift Desktop/Tests/BrowserGoogleSessionTests.swiftpython3 desktop/macos/scripts/check_desktop_test_quality.py./desktop/macos/test.shpassed all launcher checks and 376 Rust tests; 336/337 Swift suites passed headlessly, and the sole AppKit pasteboard test passed when rerun in the active GUI bootstrap it requires.OMI_PR_BODY_FILE=/tmp/pr-body-browser-session.md make preflightpassed all 18 selected checks.Failure-Class: none