APP-68Recommended
Choose how edits merge before you build co-editing
Write down one merge model for each kind of shared data. Use version checks for forms, changes ordered by the server for records with business rules, and a CRDT library for shared text and offline editing.
How to do it
Most records are rarely edited by two people at once, and Never save over a newer version is enough for them. A CRDT is a data type whose copies merge to the same result in any order, without a server deciding. It suits shared text and apps that work offline. Use a tested library, such as Yjs or Automerge, and never write your own merge algorithm. A CRDT cannot enforce a rule across records, such as stock that must not go below zero, so those changes go through the server. Pick the live connection as Choose the transport that the feature needs says.
How to check
The design note lists each kind of shared data with its merge model. Every shared document type in the code appears in the note, and a code search finds no merge algorithm written by the team.
Sources
Related rules
- APP-58 Never save over a newer version in Web app interface
- API-69 Choose the transport that the feature needs in API design
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/app-ui/live-collaboration/choose-merge-model">Agent Wranglers web app interface playbook</a>. In code you write, add a comment next to it with the same link.