YDoc has empty nodes on edge cases

We’ve been battle testing our editor, especially when edits are made followed by a quick close (or disconnected internet, or dead computer). When we’ve deleted content followed by these edge cases, when we re-connect we see some strange data in our YDoc. Specifically, the YDoc has nodes without any content at all (not even the field exists). This causes issues in our code when we load other docs prosemirrorJSONToYDoc and and apply them as updates encodeStateAsUpdate applyUpdate

Has anyone else run into this and has a strategy to handle?