Every device has a truth
Each client writes to a local store immediately and never blocks the interface on the network. Two devices can compose in the same thread at the same time, so the merge has to be meaningful instead of last-write-wins.
Messages carry causal metadata rather than a clock. Order comes from what depended on what, which is why a reply never lands above the message it answers.
Drafts are the hard case
A draft is unsent, so it has no id. We give it a temporary one, then swap it when the first keystroke is sent, and the swap is what previously duplicated text.
The fix was boring: the local store became authoritative for unsent state, and reconnect reconciles against it instead of overwriting it.
What we measurably gained
Compose latency on a saturated connection dropped to the same cost as a local write. Failed sends are now visible as failures rather than mystery hangs, which reduced related support tickets to nearly nothing.