The UI assumes the operation will succeed and shows the result before it’s saved.
The UI never assumes; it always tells you what’s actually going on.
Picture a cloud-based medication tracker. You take your morning pill 💊, tap Track Pill and close the app. That evening, you open it again, and... didn’t I install this app to help me remember?!
Unlike optimistic updates, immediate intent doesn’t give you a false sense of safety.
Once an app has lied to you, you stop trusting it. So you double-check everything yourself.
Okay, okay... these numbers are not empirically measured, yet I bet you will agree that software you can trust saves you time.
Under about 100 ms, a response feels instant, so you can even skip the pending state when the response arrives that fast. Get there for real, with a faster backend and servers close to your users.
Optimistic updates hide latency. Fast infrastructure removes it. If you can’t be fast, at least be honest.
There’s no need to freeze the board to remain honest: just show the intent on the card and keep the position. If it fails, return the card to its last confirmed position and explain what happened.
ETag and If-Match turn a silent clash into a clear error. MDN, HTTP conditional requestsuseTransition gives you an isPending flag for exactly this. React docs, useTransitionIt’s a common misconception that a queue makes optimistic updates honest, as in: keep retrying, and the change syncs eventually. But the queue doesn’t sync across devices. However, combining queues and immediate intent is actually even better.
navigator.storage.persist() asks to keep it. MDN, Storage quotas and eviction criteriaShare this page with your team and give it a star on GitHub. Let’s build reliable software people can trust.
Know a good, harmless use case for optimistic updates?
Let’s discuss it. I’m curious!
Receiving side
Sending side