According to the docs, it should be possible to create a new Y.Doc
with the same guid
like another one and these two docs should automatically sync.
But they do not:
const Doc_A = new Y.Doc()
const Doc_B = new Y.Doc({ guid:Doc_A.guid })
/**** check that they are copies ****/
Doc_A.getMap().set('from Doc_A',null)
Doc_B.getMap().set('from Doc_B',true)
console.log('Doc_A',Doc_A.getMap('').toJSON())
console.log('Doc_B',Doc_B.getMap('').toJSON())
produces the following output
Doc_A {from Doc_A: null}
Doc_B {from Doc_B: true}
(and, yes, I also tried adding them to a Y.Map
first (even the same one) but that did not help either…
In fact, the above code has been boiled down from a bigger test where I even explicitly read the inner map’s contents from both instances and compared them by value