stable

Clone or download

Read-only

Maintain the "save token" alive when user is editing the document

The token is refreshed every 5 minutes (minus a few seconds) to extends its expiration date. This make sure that when ONLYOFFICE want to save the document, the token it has is still valid. The token has a lifetime of 15 minutes and we try to refresh it every 5 minutes. This should make the process resilient enough even in case of some connectivity or server issues. The easiest way to test this change is to set a smaller refresh interval in `plugins/onlyoffice/scripts/onlyoffice-editor.ts` and to check the expiration date of the token in the database is extended. Part of story #28263: edit office document stored in Document Change-Id: I77cab4bfed5e33886c4a7f3313e3e47e1be8da3f

Modified Files

Name
M plugins/onlyoffice/include/Open/OpenInOnlyOfficeController.php +3 −3 Go to diff View file
A plugins/onlyoffice/include/Save/CallbackURLSaveTokenIdentifierExtractor.php +58 −0 Go to diff View file
A plugins/onlyoffice/include/Save/OnlyOfficeRefreshCallbackURLTokenController.php +69 −0 Go to diff View file
M plugins/onlyoffice/include/Save/OnlyOfficeSaveDocumentTokenDAO.php +14 −0 Go to diff View file
A plugins/onlyoffice/include/Save/OnlyOfficeSaveDocumentTokenRefresher.php +36 −0 Go to diff View file
A plugins/onlyoffice/include/Save/OnlyOfficeSaveDocumentTokenRefresherDBStore.php +64 −0 Go to diff View file
M plugins/onlyoffice/include/Save/OnlyOfficeSaveDocumentTokenVerifier.php +7 −6 Go to diff View file
M plugins/onlyoffice/include/Save/SaveDocumentTokenData.php +1 −1 Go to diff View file
M plugins/onlyoffice/include/onlyofficePlugin.php +32 −4 Go to diff View file
M plugins/onlyoffice/scripts/onlyoffice-editor.ts +13 −0 Go to diff View file
A plugins/onlyoffice/scripts/open-in-onlyoffice.ts +31 −0 Go to diff View file
R plugins/onlyoffice/themes/style.scss Go to diff View file
M plugins/onlyoffice/tests/integration/Save/OnlyOfficeSaveDocumentTokenDAOTest.php +20 −0 Go to diff View file
M plugins/onlyoffice/tests/unit/Open/OpenInOnlyOfficeControllerTest.php +2 −13 Go to diff View file
A plugins/onlyoffice/tests/unit/Save/CallbackURLSaveTokenIdentifierExtractorTest.php +62 −0 Go to diff View file
A plugins/onlyoffice/tests/unit/Save/OnlyOfficeRefreshCallbackURLTokenControllerTest.php +97 −0 Go to diff View file
A plugins/onlyoffice/tests/unit/Save/OnlyOfficeSaveDocumentTokenRefresherDBStoreTest.php +106 −0 Go to diff View file
M plugins/onlyoffice/tests/unit/Save/OnlyOfficeSaveDocumentTokenVerifierTest.php +1 −1 Go to diff View file
M plugins/onlyoffice/vite.config.ts +1 −1 Go to diff View file