Switching a customer workspace is more than changing the name in a navigation bar. Cached data, pending forms, background requests, and old tabs can still carry the previous organisation's context.
Define what account switching means for each active task. The goal is to keep the user's intended workspace, the request's trusted context, and the stored resource ownership aligned.
Map context that survives navigation
Inventory query caches, selected records, draft forms, uploads, export jobs, request tokens, and browser tabs. Give tenant-owned cache entries an appropriate organisation boundary and decide whether drafts remain attached to their original workspace or are discarded with confirmation.
Provider behaviour matters. The current Clerk organisation overview describes active-organisation context and multi-tab considerations. Verify your actual SDK and request path rather than assuming one browser cookie always represents the tab's intended organisation.
Exercise a fictional two-client workflow
Create client Spruce and client Hazel with unmistakably different fixture records. Give the test user editor access to Spruce and viewer access to Hazel. Open an editable Spruce request, then switch the main dashboard to Hazel.
Test the old form, the browser back button, a pending search, and a delayed upload completion. The Spruce form should not silently become a Hazel write. It should either remain explicitly attached to Spruce with current access checked or require the user to resolve the context change.
Open another tab in Hazel and return to Spruce. Submit a permitted Spruce update and attempt a forbidden Hazel update. Inspect stored ownership and values, not only the page labels. Repeat after membership is removed from one client.
Check background and generated artefacts
An export started in Spruce should remain a Spruce job even if the user later views Hazel. Its completion notification and download path need to identify the right workspace and enforce current access under the chosen policy.
Clear or isolate data that should not remain visible after switching. A stale customer name in an autocomplete can be a privacy problem even if the eventual save is correctly rejected. Review empty states and loading transitions because brief stale displays can be missed in final screenshots.
The tradeoff is continuity versus simplicity. Preserving per-workspace drafts helps busy users but requires clear labels and lifecycle rules. Clearing all state is simpler but can cause data loss or frustration. Choose deliberately and test the real workflow.
The StackFlight portfolio account gives related authenticated-product context. Spruce and Hazel are fictional test organisations, not a description of its current tenancy model.
Questions about account switching
Should switching always cancel pending requests?
It depends on the operation. Prevent stale results from entering the wrong workspace and keep consequential work bound to an explicit original context.
Are visual labels sufficient?
No. Verify trusted request context, cache keys, resource ownership, and stored mutations. A correct label can sit above incorrect cached data.
What should a bug report capture?
Record both workspaces, roles, tab sequence, pending operation, and stored outcome. Bring a minimal reproduction to a tenant-context review.