Message Delivery Guarantees in Chat Apps: Sent, Delivered and Read Receipts
How chat systems guarantee delivery: at-least-once with acknowledgements, idempotent client message IDs, per-conversation sequence numbers and receipt ticks.
Published November 27, 2026
The single tick, double tick and blue ticks in WhatsApp are a user-facing view of a careful delivery protocol. Mobile networks drop packets, phones go to sleep and servers restart, yet users expect every message to arrive exactly once and in order. This article explains how acknowledgements, retries, deduplication and sequence numbers combine to deliver that experience.
The concept
Exactly-once delivery over an unreliable network is impossible in the strict sense, so chat systems implement at-least-once delivery plus idempotency, which looks like exactly-once to the user. The sender retries until it receives an acknowledgement. Because a retry may duplicate a message that actually arrived, every message carries a client-generated unique ID, and the server and recipients discard duplicates.
Each tick corresponds to an acknowledgement. One tick: the server has durably stored the message and acknowledged the sender. Two ticks: the recipient's device acknowledged receiving it. Blue ticks: the recipient opened the conversation, and a read receipt flowed back. Receipts are themselves small messages that travel the same reliable path in reverse.
The receipt protocol
Delivery semantics
| Guarantee | Meaning | Chat usage |
|---|---|---|
| At-most-once | Send once, never retry | Typing indicators, presence pings |
| At-least-once | Retry until acknowledged | Messages and receipts |
| Effectively exactly-once | At-least-once + dedupe by id | What users experience for messages |
Ordering with per-conversation sequence numbers
The server assigns each message a monotonically increasing sequence number within its conversation when it is persisted. Clients display messages by that sequence, not by device clock, which can be wrong. If a client sees sequence 41 and then 43, it knows 42 is missing and requests it. Global ordering across all conversations is unnecessary and would be a scalability bottleneck.
conversation u42:u77
seq 40 Bob "See you at 6?"
seq 41 Alice "Yes!"
seq 43 Bob "Great" ← gap detected, client fetches seq 42Retries without duplicates
Practical examples
Server-side idempotent insert
A unique constraint on the client message id makes retries harmless.
INSERT INTO messages (conversation_id, client_msg_id, sender_id, seq, body)
VALUES ($1, $2, $3, nextval_for($1), $4)
ON CONFLICT (conversation_id, client_msg_id) DO NOTHING
RETURNING seq;
-- no row returned → duplicate: look up the existing seq and ACK with itClient outbox loop
Messages stay in a local outbox (SQLite) until acknowledged, surviving app restarts.
async function flushOutbox() {
for (const m of await outbox.pending()) {
try {
const ack = await socket.request({ type: 'msg', ...m }, { timeout: 5000 })
await outbox.markSent(m.clientMsgId, ack.seq) // show single tick
} catch {
break // retry on next reconnect
}
}
}Batching read receipts
Send one receipt for the highest sequence read instead of one per message.
{ "type": "read", "conversation_id": "u42:u77", "up_to_seq": 57 }Common mistakes
- Acknowledging the sender before the message is durably stored.
- Generating message IDs on the server only, so client retries create duplicates.
- Ordering by device timestamps, which jump around with bad clocks and time zones.
- Sending one read receipt per message in busy group chats, multiplying traffic.
- Promising strict exactly-once delivery instead of designing for idempotency.
Key takeaways
- Chat uses at-least-once delivery plus deduplication by client message id.
- Ticks map to acks: stored, delivered to device, read.
- Per-conversation sequence numbers give ordering and gap detection.
- A persistent client outbox makes sending survive restarts and network loss.
FAQ
How does the server know a message was delivered if the recipient is offline?
It does not until the recipient reconnects, downloads pending messages and sends delivery acks. The sender sees a single tick until then.
Can users disable read receipts?
Yes, it is a privacy setting. The client simply does not send READ events (and conventionally stops seeing others' read receipts).
How are receipts handled in groups?
Each member's device acknowledges separately. The sender sees aggregated state (delivered to all, read by all) and can view per-member details.