Skip to content

Fix workspace switch cache isolation#517

Merged
baxen merged 1 commit into
mainfrom
fix/workspace-switch-cache
May 9, 2026
Merged

Fix workspace switch cache isolation#517
baxen merged 1 commit into
mainfrom
fix/workspace-switch-cache

Conversation

@baxen
Copy link
Copy Markdown
Collaborator

@baxen baxen commented May 9, 2026

Summary

  • scope React Query caches to the active workspace by creating a fresh query client per workspace boundary
  • gate workspace-scoped UI on the exact workspace config applied to the Tauri backend
  • keep the app updater provider outside the workspace reset boundary

Testing

  • cd desktop && pnpm exec biome check src/app/App.tsx src/main.tsx src/features/workspaces/useWorkspaceInit.ts src/shared/api/queryClient.ts
  • cd desktop && pnpm exec tsc --noEmit
  • manually tested switching between two workspaces and confirmed stale channel lists no longer persist

@baxen baxen requested a review from wesbillman as a code owner May 9, 2026 00:36
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c4cf2a541

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

activeWorkspace?.id,
activeWorkspace?.relayUrl,
activeWorkspace?.token,
workspaceKey,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude reinit-only key from workspace reset trigger

Adding workspaceKey to this effect’s dependencies makes every reconnectWorkspace() bump run resetWorkspaceState(), even when the active workspace is unchanged. In the deep-link flow, reconnectWorkspace() is always called after connect handling, so reconnecting to an already-active relay now clears module caches such as drafts (clearAllDrafts) and search hits for the same workspace, which is user-visible data loss rather than cross-workspace isolation.

Useful? React with 👍 / 👎.

@baxen baxen merged commit db4a3ef into main May 9, 2026
15 checks passed
@baxen baxen deleted the fix/workspace-switch-cache branch May 9, 2026 19:07
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.

2 participants