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

Empty objects are not returned #453

Closed
raymonddaikon opened this issue Sep 7, 2024 · 0 comments
Closed

Empty objects are not returned #453

raymonddaikon opened this issue Sep 7, 2024 · 0 comments

Comments

@raymonddaikon
Copy link

raymonddaikon commented Sep 7, 2024

When a Loro map value is an empty object, calling .toJSON() on the Loro map will omit the value. This is specifically a problem in loro-prosemirror where the attributes key is often an empty object. This is specifically a problem in nested containers as top level values will return an empty object, but for nested values inside Loro Lists etc. the value is completely omitted even though the data is being detected in the batch event diff. For example setting text as bold in prosemirror will trigger a change event on the map that will return diff: [{ attributes: bold: {}, retain: 1 }] but calling .toJSON() on that map will return attributes: {}. Update: Was reading the logs wrong, as it was changing the attributes value on the LoroText instead of the Map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant