Prose Mirror editor is locked when snapshot is applied

I’m trying to understand how to use the snapshot feature for versioning.

I’m using the yjs prose mirror versions demo (no changes, out of the box).

When you select a snapshot version, the editor becomes “locked” (i.e you can’t focus or edit anything).

I’ve tried using this PR to restore the snapshot and the restoration works fine but the same thing - you can’t edit or focus. What’s weird is that using the toolbar I can select “bold” (for example) and indeed change a word to bold.

I’ve tried debugging this for several hours and can’t figure it out… Any ideas?

1 Like

Hi @jhaynie,

someone just asked this question: Live tracking / Track changes

This is not a bug. It is the intended behavior… for now. As explained in the above discussion this feature is only supposed to track changes from other users live.

Changes applied from the toolbar are probably not propagated. This is indeed a bug.

Thanks for the quick reply and I had read his post but didn’t notice his same behavior comment :man_facepalming:.

Are there examples anywhere of applying a snapshot to a doc to restore to a previous point in time in a way that would propagate correctly to connected clients?

@tommoor I recommend to extract the previous state, and then overwrite the existing state. It would be great to eventually have helper functions for this. At the moment you have to do this manually.