Support file locking
ownCloud 10.5 introduced file locking which basically allows users to lock a file while working on it. It would be nice if Collabora supports this as it's one of the main collaboration tools for ownCloud.
Steps
- Enable file locking:
occ config:app:set files enable_lock_file_action --value yes. - Login, create a new .doc file and lock it .
- Share this file with another user in your ownCloud.
- Login with this other user, edit the shared file with Collabora.
Expected result
The file is being opened in view only mode because it is currently locked by another user.
Actual result
The file is being opened in edit mode despite being locked by another user.
We have supported this for quite a while in the Collabora Online core - somehow horribly; we didn't get back to updating this bug. Essentially we function much as the WOPI protocol in this regard so:
https://wopi.readthedocs.io/projects/wopirest/en/latest/files/Lock.html
We have this in loolwsd.xml - which you should prolly crank right down to debug & test this:
<locking desc="Locking settings">
<refresh desc="How frequently we should re-acquire a lock with the storage server, in seconds (default 15 mins) or 0 for no refresh" type="int" default="900">900</refresh>
</locking>
You need to return:
Storage.cpp: JsonUtil::findJSONValue(object, "SupportsLocks", _supportsLocks);
from your CheckFileInfo as a boolean - to 'true'
Then we will send lock and unlock requests and refresh the lock with a fresh lock request periodically as described.
Very happy to help if you have questions.
Thanks!