Order the steps
Order what happens when the user adds an item to the cart offline.
- Queue a mutation with an idempotency key in the outbox
- When online, the sync engine sends the outbox and pulls server changes
- Write the change to the local database
- Resolve conflicts and update the local database
- The UI updates from the database
Hint 1 of 1
Local first, network later.
Choose an answer, then open Show answer below to check it.
Show answer
Answer: C E A B D
- Write the change to the local database The local store is the source of truth.
- The UI updates from the database The user sees the change immediately.
- Queue a mutation with an idempotency key in the outbox The outbox persists the intent across launches.
- When online, the sync engine sends the outbox and pulls server changes Sync runs whenever the network allows.
- Resolve conflicts and update the local database The UI reflects the reconciled state.