yjs / y-prosemirror

ProseMirror editor binding for Yjs
https://demos.yjs.dev/prosemirror/prosemirror.html
MIT License
344 stars 119 forks source link

node duplicate on page reload when enforcing a custom node as first block in collaborative setup #167

Closed LeongLRF closed 1 month ago

LeongLRF commented 1 month ago

Please save me some time and use the following template. In 90% of all issues I can't reproduce the problem because I don't know what exactly you are doing, in which environment, or which y-* version is responsible. Just use the following template even if you think the problem is obvious.

Checklist

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Enforce a custom node as the first block
    export const Doc = Document.extend({
    content: 'title block*',
    addAttributes() {
        return {
            creator: {
                default: null
            }
        }
    }
    })
  2. setup the collaboration
  3. editor a page in two browser
  4. reload the page

Expected behavior the custom node should not duplicate

Screenshots first load: image reload: image

Environment Information

Additional context Add any other context about the problem here.