Undo Send does not recall anything. Once a message reaches someone else's mailbox, there is nothing left to pull back. What the button does is make the send…

Undo Send does not recall anything. Once a message reaches someone else's mailbox, there is nothing left to pull back. What the button does is make the send late. Gmail's help page, "Unsend a sent email", describes a cancellation window you can set to 5, 10, 20 or 30 seconds. While it is open you see "Message sent" with an Undo link. How Gmail implements that internally I don't know, and I won't guess.

The behavior you can observe is consistent with a simple design: hold the message, give the person a few seconds, then do the part that cannot be reversed. That design is worth copying for any action where reversing costs more than waiting: sending a message, publishing a post, placing an order, bulk-deleting records. The idea fits in a sentence. The details are where it goes wrong, so this article walks through them in Kotlin. I use Room and coroutines for concreteness.

The same shape works in KMP with a different persistence layer, and in any language with a transactional store. Delay the irreversible step There are two ways to "undo" something. You can cancel it before it happens, or you can compensate after it happened: refund the charge, mark the email as recalled, delete the post. Compensation leaves a trace and often cannot reach everyone who already saw the effect. Cancelling a job that has not run leaves nothing behind.

So the first rule is about where the irreversible step sits. It moves later, behind a window, and everything the outside world can see moves with it. That includes things teams forget: push notifications to the recipient, webhooks and analytics events such as message_sent, search indexing and "last activity" timestamps. If your analytics fires on tap, your dashboard will count sends that were cancelled. Fire it when the state machine reaches SENT, not before.

Keep the window short and explicit Every send is now late by the length of the window. For a chat app where people expect messages to land instantly, a five-second hold on every message would feel broken. This pattern earns its cost on actions that are expensive to reverse and not time-critical. It is the wrong choice for a one-time login code or an emergency alert. Two things make a window usable: It is visible.

Source disclosure

This is a source-linked briefing. Read the original report from Dev Community .