Modifying confirmed steps with collab plugin

We are using a collab plugin for real-time collaborative editing using ProseMirror. We store all steps in the database once confirmed and then distribute them back to clients. We use those steps to display history view for documents. All this works great.

But now we encountered use cases where we want to modify steps already stored and confirmed in the database (and distributed to clients). For example, to filter spam from history, or sensitive data. The issue is what to do about clients which are at that moment connected to the server and have document state (and collab plugin state) based on previous set of steps. Ideally, we could just tell collab module to use the new document state and new version after which it would rebase any unconfirmed steps on top of this new document state. This does not seem to be possible? The best way currently seems to simply reinitialize the whole editor state to new document.

Any suggestions or pointers how to handle this case?

Have you tried using EditorState.reconfigure?

Hm, I do not see how this could help? I could send a new collab plugin instance with maybe different version number, but I do not see where I can update the document state in the plugin? Or what to do with unpublished steps?

Ah, that’s true, the document is fixed. So yeah, I guess you will have to create a fresh state.