ONLYOFFICE Document Editor Changes Are Not Being Saved Back to My Website After Editing Session Ends

Hello ONLYOFFICE Community,

I am currently facing a persistent issue with my website’s integration with ONLYOFFICE Document Server, and I am hoping someone can help me understand what I may be missing. The core problem is that users can successfully open and edit documents through the embedded ONLYOFFICE editor, but after they finish editing and close the document, many of their changes are not saved back to my website. The editing experience itself is completely normal, with no visible errors while users are typing, formatting text, inserting tables, or making other modifications. However, once the editing session ends and the document is reopened later, the file stored on my website still contains the older version instead of the latest changes. This happens intermittently, making it difficult to identify a consistent pattern or reproduce the issue on demand.

The problem appears to occur specifically during the save process between ONLYOFFICE Document Server and my website. From what I understand, the editor should notify my application through the callback URL whenever a document is ready to be saved. My application is configured to receive these callback requests and replace the existing document with the updated version provided by ONLYOFFICE. However, although the editing session completes normally, the callback either does not seem to arrive in every case or the latest document is not always written correctly to storage. There are no obvious errors displayed to the user, so they naturally assume that all changes have been saved successfully. It is only when the document is opened again that they discover some or all of their edits are missing.

To troubleshoot the issue, I have verified that the callback URL is publicly accessible and that my application responds successfully when tested manually. I have also reviewed the integration settings to ensure that the document key, file URL, callback URL, and configuration parameters are being generated correctly for each editing session. The document opens without any issues, user permissions are applied correctly, and collaborative editing functions appear to work normally while multiple users are editing at the same time. Because the editor itself functions exactly as expected, I suspect the problem is occurring during the communication between Document Server and my application after the editing session has finished rather than during the editing process itself.

Another aspect that makes this issue particularly confusing is that it does not affect every document or every editing session. Some documents are saved correctly with every change preserved, while others lose the latest modifications even though the editing workflow was identical. I have compared documents of different sizes and formats, including DOCX files with simple text and larger documents containing tables, images, and formatting, but I have not identified a clear relationship between document complexity and the save failure. Since the behaviour is intermittent, I am unsure whether it is related to callback timing, session completion, document status handling, or some other part of the integration that only becomes apparent under specific conditions.

I have also enabled detailed logging within my application to monitor incoming requests from ONLYOFFICE Document Server. In some successful cases I can clearly see the callback request arriving with the expected document status and download URL, after which my application retrieves and stores the updated file correctly. However, in the failed cases there are either no corresponding callback entries or the callback sequence appears incomplete despite the user having closed the document normally. Because there are no visible errors in the browser and the editing session itself appears successful, I have been struggling to determine whether the issue is caused by my callback implementation, the Document Server configuration, network timing, or an incorrect interpretation of the document status values.

I would greatly appreciate guidance from the ONLYOFFICE community on how to properly diagnose and resolve this issue. Specifically, I would like to understand the recommended way to verify that callback requests are always being delivered, how to confirm that the correct document status values are being handled before replacing the stored file, and whether there are common implementation mistakes that can cause document changes to be lost even when the editor closes without errors. Any recommendations regarding callback processing, logging, session handling, or best practices for integrating ONLYOFFICE Document Server with an external website would be extremely valuable. My goal is to ensure that every document edited through ONLYOFFICE is saved reliably back to my website without users ever losing their latest changes. Very sorry for long post!

1 Like

Hi, and no need to apologise for the detail — it’s useful.

Your users’ changes are most likely not lost. While a document is open, edits are stored in Document Server’s own database — the “All changes saved” indicator in the editor refers to that, not to your storage. The actual transfer to your website only happens after the last editor closes: Document Server assembles the file, puts it in its cache, and then sends status: 2 with a download link. Your handler has to reply error: 0 and download the file for the save to count as complete.

If your handler replies error: 1, or if Document Server can’t reach it at the moment it sends status: 2, the assembled file isn’t discarded — it moves to the forgotten folder, which is excluded from automatic cache cleanup. Those files stay there indefinitely.

Could you check what’s in /var/lib/onlyoffice/documentserver/App_Data/cache/files/forgotten? (That’s the path for a package install — for Docker, check the mounted volume or from inside the container.)

If files are there, Document Server did assemble the document and send the callback, so the failure is on the storage side or in the network between the two — most often because DS can’t reach your callback URL from its own network, even when that URL works fine from a browser. If the folder is empty, the session never closed cleanly and no callback was sent at all.

Also, what’s your Document Server version and how is it deployed (Docker or .deb, anything proxying the callback URL)?

Thanks for the detailed explanation. I wasn’t aware that the “All changes saved” indicator refers to the changes being stored inside Document Server rather than confirming that the updated file has already been transferred back to my website. That distinction explains why the editor can appear to save successfully while my stored document still contains the older version.

I’ll check the forgotten cache directory to see whether the affected documents are present there. If they are, that should confirm that Document Server successfully assembled the updated files but encountered a problem when delivering them to my callback handler. I’ll also compare the callback logs to see whether I’m returning error: 0 correctly and whether any status: 2 callbacks are failing or being missed.

I’ll investigate the connectivity from Document Server to the callback URL as well, rather than only testing the URL from my browser. I’ll also provide my Document Server version and deployment method, including whether I’m using Docker or a package installation and whether a reverse proxy sits in front of the callback endpoint. Thanks again this gives me a much more specific way to determine whether the problem is with the callback delivery or the document session itself.

1 Like

@joeroot Glad it helped! Let us know what you find in the forgotten folder and the version/deployment details — we’ll go from there.