first working version that also considers holes in document updates - #263

This commit is contained in:
Kevin Jahns
2020-12-15 15:39:08 +01:00
parent 004a781a56
commit f8341220c3
5 changed files with 65 additions and 21 deletions

View File

@@ -56,9 +56,15 @@ export const testMergeUpdatesWrongOrder = tc => {
Y.mergeUpdates([updates[1], updates[3]])
])
;[wrongOrder, overlapping, separated].forEach(updates => {
const targetState = Y.encodeStateAsUpdate(ydoc)
;[wrongOrder, overlapping, separated].forEach((updates, i) => {
const merged = new Y.Doc()
Y.applyUpdate(merged, updates)
t.compareArrays(merged.getArray().toArray(), array.toArray())
t.compare(updates, targetState)
})
}
/**
* @todo be able to apply Skip structs to Yjs docs
*/