A laptop and a phone share a parts list. Pull the virtual cable, change both sides, plug it back in. Both sides show the same list, the page shows how each conflict was decided, and both state hashes match. Both replicas run here in your browser; the recorded runs below use two separate processes, in Rust and in TypeScript.
Each field of a part is decided on its own. A quantity changed on the laptop and a name changed on the phone are both kept.
When both sides wrote the same field, the write with the higher hybrid logical clock wins: wall time, then a counter, then the device name. A slow clock cannot make an edit lose to the write it has already seen.
A part deleted on one side stays deleted, whatever was edited on the other side and whenever. Edits it overrode are listed, not silently lost.
| Scenario | What happens | Golden state hash | Rust + Rust | Rust + TS | TS + TS |
|---|
git clone https://github.com/ce-net/demo-offline-merge && cd demo-offline-merge cargo run -- scenario partition-1 # two replica processes and the cable (cd ts && npm ci && npm run build) cargo run -- scenario all --phone ts # the phone is the TypeScript replica