mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-05 13:29:44 +02:00
Desktop tabs persist their full path to localStorage (multica_tabs), so a tab path like /naiyuan/issues survives app restarts, account switches, and workspace deletions. Any stale slug caused WorkspaceRouteLayout to render NoAccessPage immediately on login — the user saw "Workspace not available" every time they opened the app, with no way to recover except manually opening a new tab or clearing localStorage. Root cause: persisted URL strings outlive the server-state they reference. The auth initializer fetches a fresh workspace list on every startup, but nothing validated the tab paths against it. Fix: add tab-store.validateWorkspaceSlugs(validSlugs). Runs on every change to the workspace list query data (login, background refetch, realtime workspace:deleted). Any tab whose first path segment isn't in the valid slug set is reset to `/`, where IndexRedirect picks a live workspace (or /new-workspace if the user has none). Idempotent, so over-triggering is safe. Tabs on global paths (/login, /new-workspace, /invite/...) are left alone. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>