Every front-end tutorial teaches the same trick. The user taps "Place order," you flip the screen to "Order confirmed," and you sort out the server later. It feels fast. It tests well. And the whole pattern rests on one assumption: that the server will agree.
I think that assumption is the bug. Optimistic UI isn't a speed technique. It's a promise made on behalf of a system you don't control, and the people who notice when you break it are your most careful customers.
Fast is not the same as finished
The myth goes like this. Users hate waiting, spinners feel slow, so the interface should act as if the request already worked. Frameworks bless it. React ships a useOptimistic hook, and TanStack Query and Phoenix LiveView document the same move.
The part of the myth that's true is real. People do hate waiting, and a button that does nothing for 600 milliseconds feels broken.
The part that's false is the leap from "respond instantly" to "show the final result instantly." Those are two different things. One acknowledges that you clicked. The other claims the world has changed.
A developer who goes by romshark published a long critique of this called Immediate Intent vs. Optimistic Update, and the distinction is the useful part. A pending heart that says "sending" is honest and instant. A solid heart that might get yanked back in two seconds is neither.
When the screen said "sent" and it wasn't
The extreme version of this failure comes from healthcare, which is why I trust it as a stress test. In 2022 the VA's inspector general reported that the new electronic health record at the Mann-Grandstaff VA Medical Center in Spokane failed to deliver more than 11,000 orders for clinical services. They landed in an "unknown queue" that nobody was watching. Reviewers counted 149 adverse events for patients, two of them major harm.
Clinicians had done their part. They placed the orders. Nothing on their side told them the orders had gone nowhere.
I'm not claiming this was an optimistic update in the React sense. It was a hospital system, and the failure was routing, not a rollback. But it's the same shape from the user's chair. The interface let a person believe a thing was done, and the thing wasn't. Romshark uses it in his argument for the same reason.
Shopping carts don't kill anyone, so we call the stakes low. The shape of the damage is still familiar, just cheaper.
Your checkout is where the lie costs real money
Picture a store that paints "Thanks, your order is on its way" the instant someone taps pay. The payment call times out. The customer closes the tab, content. The order never existed.
Adobe's documentation for its Commerce storefront checkout is surprisingly blunt about the risk: unresolved errors can leave the local app and the backend in different states, which can mean an incorrect order. Notice who finds out. Not your analytics dashboard, which saw a conversion. Not your engineer, whose logs show a timeout nobody alerts on. The customer finds out three days later, when nothing arrives.
Now the fix everyone reaches for. Roll the screen back and show an error. That's the honest part of the optimistic pattern, and it fails in its own way. A rollback after a success screen reads like the store changing its mind. Users don't blame the network. They blame you.
I'd rather take a half second of honest "Processing" than a rollback I have to apologize for. The conversion math on a lost order is ugly, and I'd bet most teams have never measured how many of their "successes" quietly died.
The steelman, and where it breaks
The strongest defense of optimistic UI is that most actions succeed. If 99.9% of likes, reorders and checkbox ticks land, why make 99.9% of users look at a pending state for the sake of the failures?
I'll concede a lot of that. For a like, a drag-and-drop reorder or a toggle you can flip back, optimism is fine. The cost of being wrong is small and the user can see the consequence and fix it.
It breaks in two places. The first is anything the user can't easily check later: a payment, a booking, a sent message. The second is the one nobody budgets for, which is trust that, once cracked, doesn't repair itself.
Romshark's piece collects the research on this. He cites work by Dietvorst and colleagues showing people abandon an algorithm after watching it make a single mistake, even when it beats a human overall. His own caveat is that he hasn't measured the time cost. I'd add mine: the users who start double-checking your app after one false "saved" are the ones who read the details, upgrade plans and file support tickets. You trained your best customers to stop believing you.
What I'd ship instead
Show the intent, not the outcome. When someone taps pay, the button changes to something truthful within 100 milliseconds, "Paying...", with the order summary frozen in place. When the server answers, the screen changes to the real result. That's not a spinner. It's a receipt that hasn't printed yet.
Then make the retry boring. Stripe's answer to a timed-out payment is an idempotency key. Your client generates one, sends it in the Idempotency-Key header, and reuses it on retry so the same operation can't run twice. Stripe also tells you to treat a 500 response as indeterminate. That single word is the whole philosophy. You don't know, so the screen shouldn't pretend to.
If an action can fail in a way the user needs to know about, give them a way out while it's pending. A cancel link on a slow booking costs you almost nothing and turns a dead wait into a choice.
And where you truly can't be fast, be honest about it. The same goes for agent approval prompts. The screen should say what is actually happening to the user's stuff, not what you hope will happen.
The bet I'm willing to make
Pick one irreversible action in your product this week. Find where the interface declares success, then find where the server does. If those two moments are different, you have a lie in production, and the gap between them is how long it can survive.
My guess is that you'll find at least one gap, and that nobody on your team remembers choosing it. Someone copied the pattern from a tutorial because it felt snappy in the demo.
So here's the question I'd put to the team. If the server said no right now, what would your user believe for the next hour?
Originally published on kireev.us.
Top comments (0)