Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yjs subdocuments guids do not match after applying an update from Ycs document #3

Open
yarkoe opened this issue Mar 31, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@yarkoe
Copy link

yarkoe commented Mar 31, 2021

Describe the bug
Applying update from Ycs documents with subdocuments on Yjs documents generate new subdocuments guids.

To Reproduce
Steps to reproduce the behavior:

  1. With Ycs create a new root document.
  2. With Ycs create some subdocuments and add them to the root document.
  3. Apply update from Ycs root document to Yjs document.

For example:

// C# code

var document = new YDoc();
var subDoc1 = new YDoc(new YDocOptions(){Guid = "subdoc1"});
var subDoc2 = new YDoc(new YDocOptions(){Guid = "subdoc2"});
document.GetMap("subdocs").Set("subdoc1", subDoc1);
document.GetMap("subdocs").Set("subdoc2", subDoc2);
byte[] update = document.EncodeStateAsUpdateV2();

// send this update to Node.js (e. g. with Convert.FromBase64String())
// JavaScript code

const document = new Y.Doc()
Y.applyUpdateV2(document, updateFromYcs)

Expected behavior
Ycs subdocuments guids the same as Yjs subdocuments guids.

Screenshots
Yjs document state after applying:
image

Environment Information

  • Node.js (v14.16.0)
  • yjs (v13.4.14)

Additional context
Applying an update from a Yjs document with subdocuments to a Ycs document keeps guids as expected.
Applying an update from a Ycs document with subdocuments to the new Ycs document keeps guids as expected too.

@yarkoe yarkoe added the bug Something isn't working label Mar 31, 2021
@dmonad dmonad assigned aleksk and unassigned dmonad Mar 31, 2021
@aleksk
Copy link
Collaborator

aleksk commented Apr 12, 2021

Working on the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants