3 ms·
It's right there in the README: > The only case Automerge cannot handle automatically, because there is no well-defined resolution, is when users concurrently
by kaoD 9y ago
It's right there in the README:
> The only case Automerge cannot handle automatically, because there is no well-defined resolution, is when users concurrently update the same property in the same object (or, similarly, the same index in the same list). In this case, Automerge arbitrarily picks one of the concurrently written values as the "winner":
https://github.com/automerge/automerge#conflicting-changes https://github.com/automerge/automerge#conflicting-changes
- sli 9y agoMerge conflicts are handled transparently and seemingly indeterminately? Yikes.
- kba 9y agoThis isn't for a banking system, this is for building collaborative apps. If you press "A" and your friend press "B" into a Google Docs document at the same time, you also don't know if the document is going to read "AB" or "BA". In practice, this is not an issue.
- nolok 9y agoWell, so much for "no changes are lost", instead it should be "one of the change is lost, and you can't know which one until it's done ! Suprise !!!"
- kba 9y agoThere is a change history. No changes are lost.
- KirinDave 9y agoCan clients quickly access the change history to figure out what happens? Can the relevant change history for an object or a proposed change be retrieved in linear time?
- pvh 9y agoConflicts are surprisingly rare, and when they are detected they show up in the _conflicts list for resolution per your needs. What automerge guarantees is that unless you care about the conflict you don't need to take any action.
- KirinDave 9y agoThis is very disheartening, because there are a few reasonable strategies: 1. CRDT like linear change rules. 2. Vector clocks. 3. Forking the entire tree and allowing merge queries, creating a DAG of the state that can be interactively and speculatively remerged. Just picking one winner arbitrary and silently discarding all peers sounds like the kind of thing that gets labeled as a bug when we examine concurrent data stores.
- pvh 9y agoAutomerge uses vector clocks internally to track visibility and minimize conflict and retains all alternative values in the _conflicts list for that value. Automerge must select one result to be the default consistently across all uncoordinated peers. If you don't do this, different nodes may see different documents during a conflict state, which is undesirable.
- KirinDave 9y agoOkay, good answer. I can see why for ease of use you might not just demand that clients work with the raw vector clocks.