Hello OnlyOffice!
I’m trying to develop a replay functionality for document edits in OnlyOffice. I’m are doing it by recording every web-socket event in a collaboration, and then sending those back to a empty doc. Here’s a sample of such an event for an apostrophe addition:
{
“docid”: “word-1-0”,
“change”: ““39;CgAAADEAXwA2ADMANgABABwAAQAAAEYAAAABAAAAGSAAAAADAAAA””,
“time”: 1691935192000,
“user”: “11”,
“useridoriginal”: “1”
}
Replaying edits from a single session is working great. However, it throws error when attempting to replay a single document but edited across multiple sessions by the same user. Simply appending the events from the second session and continuing the replay leads to an error. This is particularly evident when adding a new paragraph from the second session, though individual letters seem fine.
My current theory is that the docx XML document undergoes restructuring at every save (or perhaps at every open). This would then mean that the websocket events from subsequent sessions are out of alignment with the original document’s paragraphs and runs, leading to errors during replay.
If this restructuring is indeed the cause, are there known methods to prevent this XML restructuring so we can maintain consistent replay across sessions?
Any pointers in the direction on how the websocket events for collaboration works would be much appreciated!!