# Optimistic or Wait
> Show success instantly when failure is rare and cheap. Wait when money, other people, or permanence is involved.

## Situation

Does it almost always succeed, and is failure cheap?

## Decision

### Use Optimistic when

The action succeeds almost every time and a failure is easy to undo. Update the screen immediately and roll back visibly if the server says no.

- Likes, stars, reactions
- Reordering, renaming, toggling
- Failures are rare
- Rollback is simple and visible

### Use Wait when

A failure would hurt: money moves, other people are notified, or something can’t be undone. Show progress and confirm only after the server does.

- Payments and transfers
- Sending to other people
- Permanent changes
- Validation only the server can do

**The numbers:** Optimistic if it fails well under 1% of the time and rolling back costs nothing. Anything involving money, other people’s inboxes, or deletion waits for the server.

## Why

Starring a file almost never fails, and if it does we just unstar it, so it updates instantly. Payment waits for the bank, because showing success early would be a lie.

## Edge cases

Chat messages are sent optimistically because a failed message stays visible with a ‘Not sent, retry’ state. Optimism works when failure stays visible.

Source: https://productfordesigners.com/cards/optimistic-wait
Author: Alex Dovhyi
