I want to store the users history and list the history, is it possible to store the yjs document edit history? restore the history. I have read the Y.UndoManager - Yjs Docs only found the undo redo. I also tried like this:
ydoc.on('update', (update) => {
undoManager.storeUndoState();
});
but did not found the store method. I am using y-codemirror.next
as the codemirror tool, y-websocket as the server side.
I store historical data in the database. When users click the save button, a complete document data is stored in the database. However, there is an issue during recovery. During recovery, the old document will be concatenated to the historical records due to the synchronization logic of yjs. If you are not concerned about this issue, you can proceed this way.
I also tried to store all document into database, but I still want to store the diff into database.
I feel like we’re facing the same issue. Are you trying to compare content between different historical versions of the document? Maybe we can help each other. Here’s my email: feifeiyhb@163.com or WeChat: Wallace_Yhb.
I store the full document into database now, but there is the problem that when the document increase, every versions store the full document that make the store size increase rapidly.