Messaging

Chat looks like the simplest product in software and contains one of its hardest problems: agreeing what order things happened in.

Ordering is where naive implementations break. Device clocks disagree, one participant is on a slow connection, someone was offline for an hour and their messages arrive in a batch — and if the client sorts by timestamp, two people can see the same conversation in two different orders, which makes the transcript incoherent. Logical ordering that does not depend on wall clocks, and a defined rule for inserting messages that arrive late, is the foundation everything else sits on.

End-to-end encryption is an architectural commitment, not a toggle. Once the server cannot read messages, it also cannot search them, cannot generate a useful notification preview, cannot moderate content, and cannot help a user who has lost every device recover their history. Multi-device support becomes a key distribution problem. These are all solvable, and they are all considerably more work — so the decision belongs at the start, made against what the product actually needs rather than because it sounds responsible.

Delivery is the feature users notice only when it fails. A message must reach every device, survive the app being killed by the operating system, arrive as a push notification when the app is closed, and never appear twice. That means an outbox that retries with deduplication, a sync protocol that lets a device that has been off for a week catch up without downloading everything, and receipts that reflect what actually happened rather than what the sender hopes did.

How we work

  • Message ordering is logical rather than clock-based, so two people never see the same conversation differently.
  • The encryption decision is made at the start against what the product needs, because it constrains search, notifications, moderation and recovery.
  • Delivery uses a retrying outbox with deduplication, so a message arrives once even across app kills and lost connections.

What this includes

Pick what you need and send it over.

Related