fw-09 step 03 — Optimistic updates and invalidation

Tasks

  1. Optimistic update with rollback.
  2. The hard case. Apply an optimistic edit; receive a different server update; then fail the mutation. Roll back to what? Implement snapshot-restore, then invalidate-and-refetch, then an optimistic layer over server state. Compare.
  3. Invalidation: exact key and by key prefix. Explain why array keys beat string keys for this.
  4. Pagination and dependent queries.
  5. Garbage collection of unobserved entries.
  6. Write the review guidance: optimistic UI is a latency optimisation that trades correctness under concurrency. Name the data in your own product for which it is wrong.

Done when

  • Three rollback strategies implemented and compared on the moved-base case
  • Prefix invalidation working
  • A written contention judgement for real data you own