Failed test with initial schema hack #445
Closed
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.
This test fails after I save and then re-load the document. If you remove lines 1445 and 1446, the tests pass. If you port this test to preview.4, the test passes. So this seems to be a bug somewhere between preview.4 and preview.5. I did a git bisect and found that hash 325f9e8 is the first bad commit.
This is a hack for supporting branching and merging from unrelated documents that were created within the same app. It is not directly supported by the Automerge API, which is probably how the bug snuck through. I think it's important to make this hack more automatic in the Automerge API. If I get some time to think about it I can say more or make a suggestion about how the API should work. Without this, there is no way to get reliable behavior for merging two branched documents that don't start with a single author.
EDIT: On further investigation, I found that
changeIndexByHash
does not contain actor0000
in the re-hydrated version of the document. https://github.com/automerge/automerge/blob/main/backend/new.js#L1523