Chainpad
Created on 2021-01-29T19:36:14-06:00
Checkpoints: a complete copy of the document.
Simplification: combining patches to remove no-ops; for example if text is removed, and the same text is added, simplify would remove the unnecessary delete and additions.
Pruning: deleting the history of a document which occured prior to a checkpoint.
Diffing: takes two strings and generates a list of patches to turn one in to the other.
Inverse patch: a patch which undoes the effects of the patch.
Checkpoints
Checkpoints are created sometimes to minimize the amount of patches which have to be applied to synchronize with the current world state.
Operations
- apply: apply a patch to a document and return the changed document
- merge: combine two patches in such a way they can now be applied to the same document
- invert: create a patch that would reverse any changes made by the given patch against the input document
- simplify: remove overlapping instructions from patches
- transform: ???
Merge
Authorative and Uncommitted works
Authorative: the document as the server knows it.
Uncommitted work: the document as the local user knows it.
Changes by a client apply to uncommitted work. Then a patch from authorative to uncommitted is sent to the server as a patch.
Authorative document is only updated by the server sending down a patch.
Ambiguity
The longest chain of hashes with the lowest hash values is considered the winner.