When you tap send on a chat message, something happens in milliseconds. The message appears on someone else’s phone. A few seconds later, your own device shows a read receipt. What happens in between? A detailed, step-by-step breakdown of that journey is now available online. Source: dev.to.
What Happens When You Send a Message
After you tap send, a message begins a journey through digital infrastructure. It starts on your phone, moves to a server, and then reaches the recipient’s device. The full sequence—frame by frame—is visualized in a dedicated page.
The site, how-chat-apps-work, was built to show exactly what occurs between send and read. It uses a simplified, composite protocol that reflects common practices across messaging apps. The names of fields—like clientMsgId or seq—are chosen for clarity, not to mirror any single app’s format. This abstraction allows the explanation to remain accessible without being tied to the specific technical quirks of any one service.
Key Steps in the Message Flow
- Your phone assigns a unique clientMsgId to the message. This identifier is generated locally and ensures that each message has a distinct identity from the sender’s perspective.
- The server assigns a sequence number (seq) and stores the message. This sequence number is used to maintain order and ensure messages are delivered in the correct chronological order, even when multiple messages are sent simultaneously.
- A read receipt is a position (READ upTo=1042), not a flag on every message. This means the system tracks where a user has scrolled in a chat, rather than marking each message as read. This approach improves accuracy and prevents over-reporting of read status.
- Messages are delivered through an always-on connection using DNS, TCP, TLS 1.3, authentication, and heartbeat signals. These layers ensure that the connection remains stable and secure, even under network fluctuations or device movement.
- Delivery continues even when the app is closed, using services like APNs (Apple Push Notification Service) and FCM (Firebase Cloud Messaging). These background services allow the app to sync messages to the device when it is reopened, ensuring no messages are lost.
For media like photos or videos, the file is first stored in blob storage. The message then carries a pointer and an encryption key. This ensures files are securely transmitted and accessible only to intended recipients. The file is not sent in full over the network; instead, a reference is stored, reducing bandwidth usage and improving performance.
How Read Receipts Work in Groups
In group chats, a read receipt is not a flag for every message. Instead, it shows a count of members whose read position is past the message. This is known as fan-out on read, distinct from fan-out on write. When a message is sent, the server records the sequence. A read receipt updates only when a member scrolls past the message. This prevents over-reporting and improves accuracy.

The Lost ACK Scenario
One of the most critical challenges is the lost acknowledgment (ACK). When a message is sent, the sender expects confirmation that it reached the server. If the ACK fails to arrive, the sender may resend the message.
However, if a new message ID were assigned during a retry, the recipient might see the same message twice. To prevent this, the retry reuses the original clientMsgId. The server checks for duplicates using a query like:
SELECT seq FROM messages WHERE chat_id = ‘c_8f2a’ AND sender = 31337 AND client_msg_id = ‘a-7d1c9e’;
According to the implementation, if the message already exists in the database, the server returns the same ACK it sent initially. This ensures message deduplication and avoids duplication in the recipient’s feed. The inclusion of the sender ID in the query key is necessary because different devices may independently generate identical clientMsgId values, which could otherwise result in duplicate messages being delivered.
The simulator chapter allows users to reproduce this scenario. With two virtual phones and a server, users can take one phone offline, tick ‘Drop the next ACK’, send a message, and observe how the retry is deduplicated without duplication in the recipient’s feed. This hands-on experience demonstrates how the system handles network failures and maintains message integrity.
Real-World App Comparisons
The site compares messaging apps including LINE, WhatsApp, Signal, iMessage, Messenger, and Discord. These comparisons cover transport protocols, end-to-end encryption (E2EE), and group functionality. Each claim is backed by a primary source—such as a whitepaper or engineering blog. Where no official documentation exists, the site shows a dash. This transparency helps avoid assumptions.

Discord had made DAVE (its MLS-based E2EE) mandatory for every voice and video call except Stage channels in March 2026. Apple and Google had started a beta of E2EE RCS between iPhone and Android in May 2026. Both are fixed now. The site does not assert a direct link between the RCS beta and MLS in public documentation, as no primary source has been identified that explicitly connects the two. As a result, the statement is presented with caution. If you know a vendor has said otherwise, open an issue with the link to ensure accuracy.
Technical Implementation
The site uses Astro to render diagrams as SVG at build time. This allows the page to function without JavaScript. A custom element, <seq-player>, enables step-by-step navigation on mobile and desktop. On a desktop, the diagram follows the text as you scroll. On a phone, you step through it with buttons. Every step has its own link (#retry-6), so you can send someone the exact moment you mean.
English and Japanese versions share the same step data. Each string is stored as { en, ja }, and the tests fail if one language is missing or the two drift apart in structure. Playwright runs both languages on desktop, on a phone and in dark mode, with axe checking accessibility as it goes.
Code is licensed under MIT. The writing and diagrams are licensed under CC BY 4.0, allowing reuse with attribution. This open licensing ensures that the content can be adapted and shared freely, promoting transparency and educational use.
For readers interested in similar technical explorations, see how a local-first editor handles large documents. Or explore a peer-to-peer media client for Linux.
Sources & further reading
Featured image: original publisher image. Via original publisher. Image source
