Hours after a member of a community-events mobile app creates an event offline and invites friends to it, the server rejects the create; how do you roll back and tell the user?
answer
- the dependants fall with their parent
- undo the claim, keep the content
- rebuild from the confirmed base
- temporary failure is not rejection
- inline, reversible, never silent
basics
~20 sUndo what claimed success — the event shown as published, the invitations shown as sent — but keep the member's work as an unpublished draft with the reason, offering fix-and-resend or discard; never revert silently.
solid answer
~50 sFirst, only a permanent refusal triggers this; a timeout or a `503` keeps the write pending. The rejected create takes its dependants with it: the queued invitations and later edits target an event the server never created, so they are held back, not sent. For the screen, rebuild from the confirmed base — for a create there is none, so the event leaves the published views — but do not delete the member's details and guest list: turn them into an **unpublished draft** that carries the server's reason, with **Fix and resend** and **Discard**. Tell the member where the event lived, as an inline failed state on its card, plus a notice they see the next time they open the app if it happened in the background. A blocking alert alone is easy to dismiss and forget; a silent revert makes the app look like it lost their data.
go deeper
Recall that an optimistic change can be refused later, and that the app must then show the refusal rather than quietly undoing the change.
Explain why invitations and edits queued after a refused create fall with it, and why a timeout is not a refusal.
Demonstrate rebuilding from the confirmed base instead of snapshots, keeping the member's content as a draft, and an inline, explained failure state.
Set one rejection policy across teams: which refusals keep a draft, how failures surface after hours offline, and who owns the wording.
## The scenario A member of a community-events app creates **Sunday Riverside Clean-up** while offline, invites five friends, and later edits the meeting point. All three writes were optimistic: the event appeared in their list as if published, the invitations showed as sent. Hours later, back online, the server refuses the create — the start date is in the past by the time it arrived, or the area does not allow member-created events. This is a **late rejection of this write**, not a clash with someone else's edit; handling concurrent edits is a different design. ## Step one: is it really a rejection? Only a **permanent** refusal triggers a rollback. A timeout, a lost connection or a `503 Service Unavailable` (which may carry `Retry-After`) says "not now" — the write stays pending and the outbox retries it later. A `422 Unprocessable Content`, a `409 Conflict` with the event's current state, or a `403 Forbidden` says "not this request as it stands" — retrying it unchanged on a timer is not the remedy; the member has to decide what to do. Classifying responses is the queue's job; this design starts once a write is known to be refused for good. ## Step two: what falls with it The create is the **parent** of everything queued after it that refers to the event: - the five invitations target an event id the server never created; - the meeting-point edit modifies an event that does not exist. Sending them would only produce more failures, so they are held back with the parent — the queue owns stopping them. For the screen, they fall with it: no invitation may still show as sent. ## Step three: rebuild, don't patch The reliable way to undo is to **rebuild the shown state** from the last confirmed server copy plus the changes that are still valid. For a created event, the confirmed copy is "no such event", so the event disappears at once from every view that presented it as published — the area's event list, the map, the attendee lists — and the member's own list shows it as a draft instead. The tempting alternative — store a **before-snapshot** per write and restore it — breaks exactly here: restoring the snapshot taken before the meeting-point edit puts back the details as they were after the create, which is still a published event that does not exist. Snapshots undo one write; a rebuild undoes a write and everything stacked on it. ## Step four: undo the claim, keep the content Rolling back the **claim** is not the same as deleting the **content**. The member typed a title, a description, a meeting point and picked five friends; none of that is wrong, only its publication failed. So: | Item | After the rejection | |---|---| | Event shown as published | removed from published views | | Title, description, meeting point | kept, in an unpublished draft | | Five invitations | kept with the draft, shown as not sent | | Server's reason | shown on the draft, in plain words | | Actions offered | **Fix and resend**, **Discard** | When the member fixes the date and resends, the create and the invitations go out again as new writes, from the draft. A simpler case uses the same rule: an RSVP to an event that **filled** before the RSVP arrived. Undo the claim ("going" becomes "not going"), keep nothing to fix, and say why — "the event was full when your reply reached it" — with the next action, such as joining a waiting list if the product has one. ## Step five: tell the member, proportionately 1. **Inline, where the thing lived.** The draft sits where the event was, marked as not published, with the reason and the actions. This is reversible and needs no immediate decision. 2. **A notice on next open** if the rejection arrived while the app was in the background — a banner or an item in an in-app activity list, so the member learns about it without hunting. 3. **Not a blocking alert alone.** A modal is easy to dismiss and leaves no trace; if one is used, the inline state must remain afterwards. 4. **Never a silent revert.** An event that simply vanishes reads as a bug that ate the member's work, and the friends they thought were invited were never told. ## What the interviewer listens for - Separating temporary failure from permanent rejection before touching the UI. - Recognising that dependent writes fall with their parent. - Rebuilding from a confirmed base instead of restoring per-write snapshots. - Keeping the member's typed content while undoing what claimed success. - A failure UX that is inline, explains itself and offers a next step.
- Why does restoring a per-write before-snapshot fail when later edits sit on top of the rejected write?A snapshot captures the record before one write. Restoring the one taken before the latest edit brings back a state that still includes the rejected create, so the event stays published. Undoing a write that others built on needs the shown state rebuilt from the last confirmed copy plus only the changes still valid.
- The rejection arrives while the app is in the background; how does the member find out?The draft's failed state is written to the store right away, so it is there on next open. Add a visible notice for that open — a banner or an entry in an in-app activity list — and, if the product already uses device notifications for event updates, one there; the inline draft remains the lasting record.
- When resending a fixed draft, should it reuse the original request?No: the draft holds new content, so it is a new write with its own identity, sent as a fresh create followed by the invitations. Replaying the refused request unchanged would fail for the same reason.
A paper diary kept in ink and pencil: confirmed plans are inked, unconfirmed ones pencilled. When the organiser refuses a pencilled event, you rub out that entry and every pencil note written against it — but you copy your notes onto a sticky note first, so nothing you wrote is lost, and you can try again.
- Delete the rejected event silently; the server never had it anyway.
- Undo only the create and keep sending the invitations queued after it.
- A modal alert is enough; once dismissed, the failure needs no trace in the UI.
- A timeout or a 503 counts as a rejection and should roll the change back.
- Restoring each write's before-snapshot rolls back cleanly even with later edits on top.