skip to content

In a dating app's mobile chat, what moves a message through sending, sent, delivered and read, and what does the sender see while offline?

level: middleimportance: must knowfreq 68%

answer

  1. four ticks, four different witnesses
  2. server acknowledgement means sent
  3. the match's device means delivered
  4. states only move forward
  5. pending is visible, never a silent drop

basics

~20 s

Sending means only the phone holds it; sent, the server acknowledged it with a sequence number; delivered, the match's device stored it; read, they viewed it. Offline the bubble stays visibly pending, and failure shows with a retry, never a silent drop.

solid answer

~50 s

Each state has a different witness. *Sending* is the local echo: the message is in the phone's database and nothing more. *Sent* is moved only by the server's acknowledgement, which carries the client id and the message's sequence number. *Delivered* comes from a receipt the match's app sends once it has stored the message, relayed by the server; *read* from a receipt sent when the message was actually on the match's screen. States only move forward: a late delivered receipt never downgrades read, and read implies delivered. Offline, the bubble keeps a pending mark with a connection banner and the client retries with the same id when the network returns; if the server rejects the message or the client's retry limit runs out, it turns *failed* with tap-to-retry. A message is never dropped silently, and a missing delivered receipt is not a failure.

go deeper

for a junior

Learn the four states and who causes each: the phone, the server's acknowledgement, the match's device, the match's eyes. Remember that an offline message stays visible as pending.

for a middle

Explain the monotonic rule, why read implies delivered, why duplicate receipts arrive, and when a pending bubble becomes failed with retry rather than silently disappearing.

for a senior

Defend why a missing receipt never triggers a resend, why a push hand-off is not delivery, and how receipts converge on a sender's second device after it reconnects.

for a principal

Weigh what the ticks promise users against cost: receipts per message per device add traffic and privacy questions, so decide which states the product shows and whether read receipts are optional and symmetric.

## Four states, four witnesses In a dating app's one-to-one chat, the ticks under a message are a promise to the sender about how far the message has got. Each tick is earned from a different party, and a design is correct only if each state is moved by its own witness and nothing else. | State | Moved by | What it promises | Typical display | |---|---|---|---| | **Sending** | The local write when the user taps send | The phone holds it; nobody else does | A clock or faded bubble | | **Sent** | The server's acknowledgement, carrying the client id and a **sequence number** | The server has taken responsibility for it | One tick | | **Delivered** | A receipt from the match's app, relayed by the server | It reached the match's device | Two ticks | | **Read** | A receipt from the match's app sent while the message was on screen | The match viewed it | Two coloured ticks | Several tempting shortcuts move a state on the wrong evidence: - A completed socket write only means the bytes were handed to the phone's network stack; the server may never have processed them. Sent waits for the server's acknowledgement. - The server handing a notification to the platform push service is not delivery; the push may be delayed, collapsed or dropped. Delivered waits for the match's app. - A delivery receipt says the message reached a client, not that a person saw it. Read needs its own signal. ## States only move forward Receipts travel on an unreliable network and can arrive out of order or more than once. The client therefore treats the state as a **monotonic** value: 1. Apply an update only if it is further along than the current state. 2. Treat read as implying delivered: a read receipt for a message still showing sent jumps straight to read. 3. Ignore a delivered receipt that arrives after read. 4. Accept repeated receipts quietly — the match may have the app on two devices, and each can acknowledge the same message. A missing receipt proves nothing. The match's phone may be off, the receipt may be lost on the way back, or the match may have turned read receipts off. A message that stays at sent for hours is still sent; the client must never resend it or call it failed because no delivered receipt came. ## What the sender sees offline The scenario's users often write on patchy mobile data. The rules for the sender's screen: - Tapping send always writes the message locally first, so it appears immediately, marked pending, with a banner saying the app is waiting for a connection. - When connectivity returns, the client resends pending messages in the order they were typed, each with its original client id, so a send that had in fact reached the server is not duplicated. - The bubble turns **failed** — a distinct mark with "tap to retry" — when the server rejects the message permanently (the match was removed, the content was refused) or when the client's own retry limit runs out. That limit is a product choice; this scenario assumes a few minutes of trying while the app is open. - Retrying a failed bubble reuses the same client id. - A message is never silently dropped. If the app is closed while a message is pending, it is still on disk, still marked pending, and is sent on the next opportunity; a pending send may ride the app's durable queue of offline writes. ## What the receiving side sends The match's client owns the other half: it sends a delivered receipt once a message is stored in its local database, and a read receipt — best expressed as "read up to sequence N" — only when the message is visible with the app in the foreground. A notification shown on the lock screen is not a read. ## How interviewers probe it The common follow-ups are "the socket write succeeded — is it sent?" (no: only the acknowledgement counts), "no delivered tick after an hour — resend?" (no: absence of a receipt is not failure), and "read arrived before delivered — what now?" (show read; never step back). A strong answer names the witness for each state and the monotonic rule before drawing any icons.

  • The sender has the app on a phone and a tablet; how do both show the same ticks?
    Ticks are server-relayed facts, not local guesses: the acknowledgement and every receipt reach each of the sender's devices, which apply the same monotonic rule keyed by client id and sequence. A device that was offline catches up on receipts along with messages when it next fetches, so both converge on the furthest state.
  • The match has turned read receipts off; what should the sender's screen show?
    Delivered, indefinitely. The match's app simply never sends a read receipt, so the sender's client has nothing to move it further; it must not infer read from time passing. A common product choice makes the setting symmetric, so a user who hides theirs cannot see others'.

  • A message is sent as soon as the socket write succeeds.
  • Delivered means the server handed it to the push service.
  • No delivered receipt after a while means the message was lost.
  • A delivered receipt that arrives after read should replace it.
  • Offline messages can be discarded if the app is closed before sending.