Repository navigation
fix(desktop): clear all onboarding state on sign-out via one shared key list - #10108
Merged
Merged
Conversation
OnboardingFlow.persistedStateKeys + clearPersistedState(in:) become the single authoritative list of account-scoped onboarding UserDefaults keys, with the deliberate exclusions (hasCompletedOnboarding, screenAnalysisEnabled, chat keys) documented at the list. Failure-Class: FC-split-mutation-authority
signOut() kept its own hand-rolled key list that missed hasSeenRewindIntro, hasTriggeredAccessibility, hasTriggeredBluetooth, and the onboarding-chat exploration keys (onboardingExplorationText/Completed, onboardingMidOnboarding, onboardingToolCompleted, onboardingGoalCompleted). Deleting an account (which signs out) then re-onboarding on the same Mac showed the previous run's answers still filled in. Route cleanup through OnboardingFlow.clearPersistedState() + OnboardingChatPersistence.clear(). Failure-Class: FC-split-mutation-authority
resetOnboardingAndRestart() drops its second hand-maintained key list and uses OnboardingFlow.clearPersistedState(), keeping only the documented hasCompletedOnboarding belt-and-suspenders removal. Failure-Class: FC-split-mutation-authority
Behavioral test that clearPersistedState removes every shared key, list- membership assertions for the keys sign-out historically missed, and static call-site tripwires pinning both clearing sites to the shared helpers — an earlier version of this fix was silently reverted by a merge resolving toward a wholesale reformat, and an isolation-only test stayed green.
signOut()'s hand-rolled onboarding key list collapsed into the shared clearing helpers, shrinking the frozen oversized file; the down-only ratchet requires the owning shard to follow.
…ring helper The nuclear-vs-light contract is unchanged: signOut() still wipes onboarding (now via OnboardingFlow.clearPersistedState()) and performLightSessionInvalidation still must not; the tripwire pins the new canonical call instead of the retired hand-rolled onboardingStep string.
kodjima33
approved these changes
Jul 20, 2026
kodjima33
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed by automated PR reviewer — scoped, correct, CI acceptable. Approving + merging.
Git-on-my-level
added a commit
that referenced
this pull request
Jul 22, 2026
…n redesign (#10340) ## Summary Restores onboarding functionality that the Second Brain redesign (#10218) dropped, re-implemented on top of the new conversational design (no old UI brought back). Each fix is its own commit: - **Auto-detect user name** (#9919) — seed the name field from the known `givenName`, kick a backend name fetch, and adopt an async name arrival (Apple sends the name only on first auth), so onboarding greets by name instead of a generic placeholder. Also re-hydrates name/language/role drafts on resume. - **Clear onboarding state on sign-out** (#10108) — `sbOnboardingResumeStep` + `onboardingRole` were added by the redesign but left out of the shared clearing list, leaking the prior user's resume step + role to the next account on the same Mac. Added both, plus a regression test. - **Drag-to-grant Full Disk Access** (#9742) — the drag-to-grant helper was wired for Screen Recording but not FDA; now both use it. - **Connector brand marks + Claude Code restart** (#10210 / #10205) — connect rows show each connector's brand icon, and Claude Code shows a restart prompt once connected so running sessions reload the new MCP config. - **Remove post-onboarding walkthrough** — the coach-mark tour that ran after onboarding (spotlighting each nav pill) is deleted; a just-onboarded user lands straight on Home. - **Pin the drag-to-grant card under System Settings** — the permission drag card was pinned to the screen's bottom quarter; it now anchors directly beneath the live Settings window (flipping above it when there's no room below) so it follows the window and never covers the drop target. ## Verification Build/manual verification pending — depends on #10334 (restores the `Package.swift`/`Package.resolved` that a stray "fixture" commit gutted on `main`, which currently breaks the desktop Swift build). This PR carries no Package changes; once #10334 lands and this rebases, it builds on the repaired manifest. ## Product invariants affected - INV-INT-1 ## Failure class (fixes) Failure-Class: none <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/10340?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
undivisible
pushed a commit
to undivisible/omi
that referenced
this pull request
Sep 29, 2026
…ey list (BasedHardware#10108) * fix(desktop): add shared account-scoped onboarding clearing list OnboardingFlow.persistedStateKeys + clearPersistedState(in:) become the single authoritative list of account-scoped onboarding UserDefaults keys, with the deliberate exclusions (hasCompletedOnboarding, screenAnalysisEnabled, chat keys) documented at the list. Failure-Class: FC-split-mutation-authority * fix(desktop): clear all onboarding state on sign-out via the shared list signOut() kept its own hand-rolled key list that missed hasSeenRewindIntro, hasTriggeredAccessibility, hasTriggeredBluetooth, and the onboarding-chat exploration keys (onboardingExplorationText/Completed, onboardingMidOnboarding, onboardingToolCompleted, onboardingGoalCompleted). Deleting an account (which signs out) then re-onboarding on the same Mac showed the previous run's answers still filled in. Route cleanup through OnboardingFlow.clearPersistedState() + OnboardingChatPersistence.clear(). Failure-Class: FC-split-mutation-authority * fix(desktop): onboarding reset iterates the shared clearing list resetOnboardingAndRestart() drops its second hand-maintained key list and uses OnboardingFlow.clearPersistedState(), keeping only the documented hasCompletedOnboarding belt-and-suspenders removal. Failure-Class: FC-split-mutation-authority * test(desktop): regression coverage for onboarding persistence clearing Behavioral test that clearPersistedState removes every shared key, list- membership assertions for the keys sign-out historically missed, and static call-site tripwires pinning both clearing sites to the shared helpers — an earlier version of this fix was silently reverted by a merge resolving toward a wholesale reformat, and an isolation-only test stayed green. * docs(desktop): changelog for onboarding state clearing fix * chore(desktop): ratchet AuthService.swift line-count baseline down signOut()'s hand-rolled onboarding key list collapsed into the shared clearing helpers, shrinking the frozen oversized file; the down-only ratchet requires the owning shard to follow. * test(desktop): INV-AUTH-1 tripwire follows the shared onboarding clearing helper The nuclear-vs-light contract is unchanged: signOut() still wipes onboarding (now via OnboardingFlow.clearPersistedState()) and performLightSessionInvalidation still must not; the tripwire pins the new canonical call instead of the retired hand-rolled onboardingStep string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(desktop): clear all onboarding state on sign-out via one shared key list
Deleting an account (or signing out) and re-onboarding on the same Mac showed the previous run's onboarding answers still filled in.
AuthService.signOut()andAppState.resetOnboardingAndRestart()each kept a hand-maintained onboarding-key list, so keys present at only one site —hasSeenRewindIntro,hasTriggeredAccessibility,hasTriggeredBluetooth, and the onboarding-chat exploration state (onboardingExplorationText/Completed,onboardingMidOnboarding,onboardingToolCompleted,onboardingGoalCompleted) — leaked across accounts.Root cause: two divergent hand-maintained lists (split authority over the same cleanup contract). Durable guard:
OnboardingFlow.persistedStateKeys+clearPersistedState(in:)is the single list both sites iterate; both sites also callOnboardingChatPersistence.clear(). Deliberate exclusions (hasCompletedOnboarding,screenAnalysisEnabled, chat keys) are documented at the list. Static call-site tripwires pin both sites to the shared helpers — an earlier version of this fix was silently reverted by a merge resolving toward a wholesale reformat while an isolation-only test stayed green.Product invariants affected
AuthService.signOut()is touched only to route onboarding-key cleanup through the shared helpers; session-death ownership (AuthSessionCoordinator,invalidateSessionvs nuclearsignOut()) is unchanged.Failure class (fixes)
Failure-Class: FC-split-mutation-authority
Verification
./scripts/dev-feedback.py --once swift 'OnboardingPersistenceClearingTests'— 4/4 pass locally and on the qualification Mac (67s).make preflight(full deterministic check manifest, same as CI Hygiene) green on the qualification Mac.AuthService.swiftshrank; owning baseline shard ratcheted down in the same PR.