yjs / y-prosemirror

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

Clear timeout when destroying plugin #92

Closed fson closed 2 years ago

fson commented 2 years ago

Not clearing the timeout causes issues where code is run after the EditorView and its plugins have already been destroyed. In our app this resulted in two errors that manifested in different cases where the editor view was being unmounted:

Both errors were fixed by applying the monkey patch kindly provided by @hoebbelsB in #70.

This PR implements that fix in sync-plugin so that we could stop monkey patching it.

hoebbelsB commented 2 years ago

@fson i've already provided a PR for it, which is open since Oct. 2021 .

just noticed there are merge conflicts, gonna resolve them tonight

dmonad commented 2 years ago

Thank you!

I'll merge this because it contains little changes that I can understand easily. I think #70 might fix another issue as well but I currently can't merge it.

I'll release a new version in the coming days with a few bugfixes. I will port the relevant changes from #70 manually.