Collaborative Editing Revert To Specific Version

I am trying to implement a feature to allow users to revert the state into stored state history. And I am doing this by

  1. Compute the new State with a Transaction that replaces the whole document with the stored document.
  2. Compute sendable steps from the new State
  3. Send the sendable steps to the server authority
  4. Receive the successful response and trigger a fetch of steps since the Editor collab version

I found that this has a problem that the View didn’t update to the replaced document. I believe it’s because receiveTransaction will filter out steps from the same client. But actually, in my approach, my editor hasn’t applied the transaction.

I don’t want to dispatch the transaction to the editor in the client first because I don’t want the client to reflect the reflection until it’s confirmed on the server. What’s your suggestion on this kind of problem? In general that we want to have transactions confirmed in the server before dispatch to the client. Thank you

This doesn’t sound like a workflow that’s supported by prosemirror-collab. You might be able to implement your own alternative to it.

Okay, I think the critical part is the receiveTransaction logic. Need to indicate some steps that are caused by the same client but not yet applied in the local.