I am trying to implement a feature to allow users to revert the state into stored state history. And I am doing this by
- Compute the new State with a Transaction that replaces the whole document with the stored document.
- Compute sendable steps from the new State
- Send the sendable steps to the server authority
- 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