Skip to content

[Export] Org switch leaks the previous org's export workspace into the new org #76

Description

@Exotic209093

Severity

Medium — wrong-org queries and result rows displayed and persisted under the new org's key.

What happens

When workspaceKey changes (org switch), both effects run in the same commit with the render's workspaceLoaded still true, so the persist effect immediately writes the old org's tabs under the new org's key before the async load resolves. If the new org has no saved workspace, the stale tabs (and, since QueryScreen's key query-1 is unchanged, its loaded result rows) are displayed and permanently saved as the new org's workspace — exportable under the wrong org context.

Evidence

  • src/ui/screens/ExportScreen.tsx:63-82

Suggested fix

Gate the save effect with a ref reset synchronously when workspaceKey changes, and reset tabs to defaults when the new key has no saved workspace.

Environment

Commit 74cf21b (main), WaveLink 0.6.0. Found in the 2026-08-31 adversarial audit (code-verified).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions