Show a check-in edit immediately, then reconcile it with the confirmed response or roll back the specific failed edit.
Build the example
Use an invented water-logging note and key the cache by day and account. Cancel stale reads before writing an optimistic value. Keep a snapshot or a mutation-scoped inverse operation, and use server-confirmed data after success. A full snapshot rollback can erase a second edit that happened later, so serialize edits for the same record or roll back by operation ID.
Start with the check-in note “walked 20 minutes” at revision 4. Optimistically show a longer note, then have the server reject that edit with revision 5 already present. Keep the server record visible and show the user’s draft separately. This case exposes whether your implementation loses information while attempting rollback.
Watch the failure boundary
A successful network response can carry a server-normalized value, such as a trimmed note or a new revision. Replace the optimistic object with that value before invalidating other readers. On an ambiguous connection failure, query the server for the current record instead of assuming it rejected the write. Keep the user’s draft available for recovery.
Verify the behavior
Simulate a slow rejected edit followed by a successful one. The final visible record should reflect the success and remove the rejected draft. Also test a server revision conflict and a screen opened on a different account. Show pending feedback until the operation settles so the UI does not present an unconfirmed edit as durable.
Sources
Technical references checked .




