Queued work should not become the next signed-in person's work. Preserve the account and workspace that originated each offline operation, then validate current authority before sending it.
Account switching is a data boundary, not merely a navigation event. Drafts, attachments, pending jobs, cached results, and delayed responses all need a clear owner.
Store ownership with the operation
Record the originating actor reference, tenant or workspace, target resource, operation identity, and relevant base revision. Do not derive ownership later from whichever session happens to exist when the queue drains.
Separate locally retained data by the access model and define what sign-out does. Some products preserve encrypted or otherwise controlled drafts for the original user; others require removal under policy. Explain any destructive outcome rather than clearing irreplaceable work accidentally.
Test a fictional shared-device handover
Suppose Dani records a customer visit offline, signs out, and hands the device to Farah. Farah belongs to another workspace. When connectivity returns, Dani's report must not be submitted under Farah's identity or displayed in Farah's pending-work list.
Test same account returning, different account, same person with another workspace, removed membership, expired session, and an app restart between users. Inspect local visibility, outgoing request context, server ownership, and attachment access.
If Dani later signs back in but no longer has permission, preserve or remove the draft according to policy and provide a meaningful review path. Current authentication does not automatically restore the old authorisation.
Keep delayed results tied to their context
A request sent before sign-out can finish afterward. Its result should not update the new account's screen or cache. Bind result handling to the operation's owner and current display context, with server enforcement at the resource boundary.
Support diagnostics should identify the operation and ownership mismatch without exposing private content to unrelated staff. Manual reassignment of work, if supported, should be an explicit authorised transfer rather than a side effect of login.
The tradeoff is user continuity versus privacy and lifecycle complexity. Preserving drafts helps field users, while shared devices require especially clear separation. A narrow product can forbid account switching with pending work if that is an acceptable documented constraint, but it must handle the blocked state safely.
The Social App case study provides related mobile and offline context. This shared-device scenario is fictional and does not assert its storage or authentication design.
Questions about offline action ownership
Can the current access token determine the queued action's owner?
It can authenticate an attempt, but it must not silently redefine the operation's original ownership. Validate both context and current authority.
Should sign-out always erase the queue?
That depends on policy and sensitivity. Treat deletion, preservation, and later recovery as explicit product behaviour.
What should a review test first?
Create offline work as one account, switch to another, reconnect, and inspect every resulting record and screen. Bring failures to an offline identity review.