Issue
- Liferay Sync is overwriting file versions of LibreOffice documents in Documents and Media
- For example, if we have Liferay Sync configured to detect changes within a directory where a LibreOffice document is actively being worked on, the updated LibreOffice document will be uploaded as a new version (v. 1.0), rather than an incremented update (v. 1.1) of an existing version.
Environment
- Liferay Sync client
- LibreOffice
Resolution
- This behavior is identified to be a limitation within Liferay Sync
- 1. When the file is saved in LibreOffice it is renamed to a temporary file name (e.g., 1.1-Document.docx~RFbca4687.TMP). The Sync client identifies this change and makes the same rename in Liferay's Documents and Media.
- 2. This temporary file is then deleted from the file system by LibreOffice, and the Sync client also performs this action in Liferay. At this point, this is why the file may go missing from Documents and Media.
- 3. Upon saving the file again in LibreOffice, the original filename is back again which the Sync client sees and then uploads, thinking it is a new file.
- Due to the naming convention used by LibreOffice (e.g., 1.1-Document.docx~RFbca4687.TMP) Liferay Sync currently does not have a way that can filter out these entries, as they appear to be valid files.
- As new versions of the Sync client will no longer be released (as it is under Maintenance Mode), this is considered a known limitation of Liferay Sync.
-
The recommendation is to:
- (a) use LibreOffice outside of the configured Liferay Sync directory, and copy over the file once the changes are finalized,
- or (b) Microsoft Office has been confirmed to work as expected in our testing, so it can be used as an alternative to using LibreOffice, due to its unique handling of temporary files.