Context
The mobile app must remain usable without a connection. 0011 defers a sync engine in favour of a mutation queue with idempotency keys; this ADR specifies that queue. Cached data can contain personal data, so it must be encrypted at rest.Decision
- Reads come from a persisted TanStack Query cache (0054), encrypted at rest. The key is held in the device secure store.
- Writes go through a persisted mutation queue; each mutation carries an
Idempotency-Keyso replay is safe. - A
409response creates a conflict record that the user or the product resolves; the queue never silently overwrites. - No sync engine (RxDB, ElectricSQL, PowerSync, WatermelonDB), as 0011 states.
Consequences
- Predictable offline behaviour from existing libraries.
- Conflict-resolution UX is a product concern for each app.
- Services must honour idempotency keys, as the HTTP conventions rule already requires.
Enforcement
Planned — queue unit tests (replay, ordering,409) in the owning package; a check that persisted cache storage uses the encrypted adapter.