Create new documents to demostrate conflict resolution #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I feel that in the existing code example, there is room for error of interpretation about conflict resolution.
Because we overwrite doc1 with the results of merge(doc1, doc2), it's unclear whether the result of merge(doc2, doc1) is influenced by the prior merge results or not.
I think it creates too much ambiguity when we pass in the modified
doc1as an input to the second merge. I caught myself thinking: "OH, so if doc1 := merge(doc1, doc2) was resolved by LWW, the values in doc1 are now newer than whatever we have in doc2, so it will automatically win again." I think that's not the intent of this section.I propose storing the results of the two merges in fresh variables, to demonstrate that the order of arguments to
mergedoes not affect the stability of winner selection.