Skip to content

fix(desktop): prevent false onboarding trigger on OTP login#1092

Open
Bohan-J wants to merge 1 commit intomainfrom
agent/j/172c0a57
Open

fix(desktop): prevent false onboarding trigger on OTP login#1092
Bohan-J wants to merge 1 commit intomainfrom
agent/j/172c0a57

Conversation

@Bohan-J
Copy link
Copy Markdown
Collaborator

@Bohan-J Bohan-J commented Apr 15, 2026

Summary

  • Fixes a race condition where Desktop app shows onboarding wizard for users who already have workspaces
  • Root cause: verifyCode (email/OTP login) sets user in auth store before listWorkspaces + hydrateWorkspace complete, causing OnboardingGate to freeze hasWorkspace=false
  • Adds workspaceHydrated flag to workspace store so AppContent can wait for definitive workspace state before rendering DesktopShell
  • Reorders AuthInitializer to hydrate workspace before flipping isLoading

Resolves MUL-888

Test plan

  • Email/OTP login on desktop with existing workspace — should go straight to main app, no onboarding flash
  • Email/OTP login on desktop with no workspace — should show onboarding wizard
  • Deep-link (Google) login — should still work correctly (protected by bootstrapping flag)
  • Session restore on app restart — should load workspace without showing onboarding
  • pnpm typecheck passes
  • pnpm test passes (all 97 tests including login-page tests)

…g workspaces

When logging in via email/OTP, verifyCode sets `user` in the auth store
before listWorkspaces + hydrateWorkspace complete. This causes AppContent
to render DesktopShell with workspace=null, and OnboardingGate freezes
that state — permanently showing the "create workspace" wizard.

Three-part fix:
- Add `workspaceHydrated` flag to workspace store (true once
  hydrateWorkspace has run, regardless of result)
- Reorder AuthInitializer to hydrate workspace before flipping isLoading
- Gate DesktopShell rendering on workspaceHydrated in AppContent
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multica-web Ignored Ignored Apr 15, 2026 0:55am
multica-web-production Ignored Ignored Apr 15, 2026 0:55am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant