Skip to content

Implement Account Switching with Offline and Error Handling #87

Description

@chadw-eten

With multiple accounts stored on a device, the app needs to switch the active session when a user selects a different account from the switcher panel. Switching must work offline and must correctly attribute all subsequent recordings and edits to the newly active account.

Functional Requirements

Switch Behavior

  • Tapping a non-active account row in the switcher panel immediately makes that account the active session.
  • Update the app state to reflect the new account's data without a full app reload.
  • Dismiss the switcher panel and return the user to the drafting view.

Offline Handling

  • Account switching works without an internet connection.
  • The outgoing account's unsynced local data is not affected by the switch; it remains in local storage and syncs the next time that account is active on a connected device.
  • The incoming account loads from its local cache if offline.

Error Handling

  • If the switch fails (e.g., corrupted local session), display an error message.
  • Keep the current account active — do not leave the app in an indeterminate state.

Data Attribution

  • All recordings, comments, and edits made after a switch are attributed to the newly active account.

Note: Only the active account syncs. Unsynced data for non-active accounts remains in local storage until that account becomes active again. Background sync across all logged-in accounts is out of scope for this feature — managing multiple concurrent sync processes adds significant complexity and battery/connectivity risk for devices operating on weak field connections. In the workshop use case, accounts naturally become active in rotation, so each account gets sync time. The edge case (a user adds their account, records, and the device never returns to them) is a known limitation shared with the single-user offline experience and should be addressed in the offline sync feature, not here.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
In PR Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions