Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support file locking #375

Open
JammingBen opened this issue Dec 22, 2020 · 1 comment
Open

Support file locking #375

JammingBen opened this issue Dec 22, 2020 · 1 comment

Comments

@JammingBen
Copy link
Contributor

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.

@mmeeks
Copy link

mmeeks commented Jul 2, 2021

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants