What it does for you
- Messages and reactions appear immediately on the other person’s phone and on your other devices.
- A phone that was offline catches up when it comes back, without gaps.
How it works
Each app keeps one authenticated WebSocket connection open to the server. When you send a message, the server writes it to the database first and only then publishes an event. Several server processes run side by side and pass events to each other over a shared publish/subscribe channel, so whichever process holds the recipient’s connection delivers it.
If the recipient is offline, a push notification wakes their phone, and the app catches up from a replay log when it reconnects. In an end-to-end encrypted chat, what travels through all of this is an encrypted envelope the server cannot read.
Under the hood
WebSocket · Node.js · TypeScript · PostgreSQL · Redis
Questions
What happens if I send a message with no connection?
The app sends it when the connection returns. Once the server has it, it is saved before anyone is notified.
How long does the server keep an encrypted message?
Until each of the recipient’s phones has its copy, at most 30 days.