server icon indicating copy to clipboard operation
server copied to clipboard

WebDav file locking to prevent overwrites

Open watermark opened this issue 10 years ago • 63 comments

It would be really nice to have true file locking in NC, such that opening a file prevents editing/opening by a second user until closed. I'm aware this has been discussed pretty heavily in the OC github, but I was hoping the opinion may be different in NC.

Our main use would be through webdav; however, it would probably be necessary to honor the lock in the web interface and possibly also the sync client.

This issue has been brought up (independently) time and time again by our customers, so it's a much sought after feature from our client base.

Steps to reproduce

  1. User 1 opens FileA in WebDav
  2. User 2 opens FileA in WebDav
  3. User 1 edits FileA and saves (which updates through WebDav)
  4. User 2 edits FileA and saves (which updates through WebDav)

Expected behaviour

User2 shouldn't be able to open and/or save their changes because User1 already had FileA open

Actual behaviour

The changes that User2 made overwrites the changes that User1 made. This is done without any notice/message/warning to User2 or User1. Neither are even aware that changes were overwritten.

watermark avatar Sep 07 '16 15:09 watermark

also interested in some solution around this, but client would be happy for it to be a plugin/manual checkout method like https://apps.owncloud.com/content/show.php/Workin2gether+(Lock+files+in+WebUI)?content=164016

putt1ck avatar Jan 19 '17 12:01 putt1ck

any news?

this is really an important feature for business-using. there is actually npo chance to edit a pool ogf files by a pool of people at the moment.

can you please say somethink about plans for that? no milestone yet?

klm46 avatar Apr 10 '17 07:04 klm46

Quite frankly I think the idea got ditched because of the integration with Collabora Online... Although it seems a bit overkill to set up a Collabora Online environment just for this purpose... :)

Kinamo avatar May 03 '17 09:05 Kinamo

Well, if installing Collabora Online means we get sync client file locks (and web client) we'd install it even if the client would never use it...

putt1ck avatar May 03 '17 09:05 putt1ck

the problem is, that then the xls and co will beopen by libreoffice. this is no possibility for me. any news?

klm46 avatar Jun 14 '17 10:06 klm46

Recently migrated from ownCloud 7 (file-locking worked fine) to a new server with ownCloud 9.1.4. File-locking doesn't work any longer but I decided to upgraded to Nextcloud with the Nextcloud installer to the latest version (12). Very easy to do but the file-locking still broken.

This is a must have "feature" like @klm46 posted on 10 April for businesses and a big deal breaker for continued use of Nextcloud for us.

grayum avatar Jun 15 '17 14:06 grayum

The Workin2gether app is now released for NC12: https://apps.nextcloud.com/apps/workin2gether - might be just what you need

putt1ck avatar Jun 15 '17 14:06 putt1ck

@putt1ck does that work for webdav though?

grayum avatar Jun 15 '17 16:06 grayum

@grayum not to my knowledge, but it also doesn't work for email attachments, USB sticks, Dropbox, WeTransfer, GDrive and all the other ways people move files around when we wish they wouldn't.

Locks via webdav (et al) also won't work if someone is editing a document offline - some things are best dealt with through policies and working practices. One client introducing NC has introduced policy of "sync only things you might work on near time or only want for reference" and then mandate users collaborating on files to visit the web interface to lock files with the aforementioned app before they start to edit them.

putt1ck avatar Jun 15 '17 16:06 putt1ck

@putt1ck I think we're getting a bit off topic. In my case (and probably most of the participants here) the customer uses webdav exclusively (via a networkmap). So files are only available online. Then if two people open the same file the first one gets no prompt and can r/w but the second gets a prompt that the file is only available for r/o. That's what ownCloud 7 did. That's the functionality my customers currently lack in NC 12.

The app you suggest involves users to use the webinterface of NC/OC and while this might work it's not very user friendly. And unrelated to the original post/request by @watermark. I do thank you for the suggestion though.

grayum avatar Jun 16 '17 12:06 grayum

this should get a bit more priority

klm46 avatar Jul 04 '17 13:07 klm46

Hi guys,

we are also waiting for this correction.

marcinkaleta avatar Jul 17 '17 13:07 marcinkaleta

hey guys, couldn't you say anything regarding this issue?

klm46 avatar Jul 25 '17 08:07 klm46

Shouldn't this be easy to fix? Just allow syncing of the .~lock.documentname.odt files, and we are done!

Or is there a way to manually allow for syncing of the .~lock files?

Btw, I understand the problem that users can work on their files offline, and in this case a lock would have no effect. In practice, people are online, so in most of the cases the lock will be effective. If they worked offline and later sync, the file should be uploaded with an corresponding name, e.g. filename-conflicted_copy_2017-05-03--12-34.odt

Thank you.

alexanderdd avatar Aug 12 '17 17:08 alexanderdd

Still a very-much-wanted feature. Any news on this?

christianpoortvliet avatar Sep 26 '17 18:09 christianpoortvliet

Same here, also customers who need this feature to avoid overwrites. MAnual locking via the webinterface is not a realistic solution IMHO. Bit of a shame that this isn't implemented, want to avoid having to install a samba access just for thus ;(

hieronymousch avatar Oct 09 '17 17:10 hieronymousch

The Workin2gether app does sound like a bit of a workaround, frankly. Most of our users use the NextCloud sync client or WebDAV to access their files. One organisation has been querying options file locking for a while, at this point we have to tell them that it's not possible.

Collabora Office is good, but it is a lot of code for the browser to execute and in our experience it doesn't work so well with really big spreadsheets or word processing documents. I see the lack of WebDAV file locking support as a current major limitation and missing feature.

My employer would probably be happy to collaborate in writing and testing code to implement this feature, though it would probably make sense for someone more familiar with the NextCloud code base to work on it.

idmacdonald avatar Dec 04 '17 10:12 idmacdonald

How do you file lock something you're not connected to?

putt1ck avatar Dec 04 '17 11:12 putt1ck

Hi @putt1ck, if a person is using the NextCloud sync client and is offline, then of course they will just be opening up a file on their local computer and there will be no way to lock that file via the server. But quite a lot of file editing, in my experience, happens via the sync client with an internet connection. But a lot of our NextCloud users don't even use the sync client, they connect directly via WebDAV clients to their NextCloud files. So they are always connecting to the server in order to open or edit files. WebDAV as a protocol has support for file locking, but WebDAV file locking is not implemented or supported by NextCloud, and so any attempts at file locking by WebDAV clients are either ignored or produce errors.

idmacdonald avatar Dec 04 '17 11:12 idmacdonald

I can only see one scenario (people all accessing files via webdav) where automated file locking will add value - but in all other scenarios it doesn't add value and potentially lulls people into a false sense of security "this file isn't auto-locked so must be ok to edit".

Where automated file locking is a useful feature, in a legacy "shared drive" scenario, it is because that is how people access files for editing. It is already breaking down because of people working around the limitations of shared drives, by using dropbox, email, Gdrive, to grab a copy of a file to work on it at home, on the train etc., and then having version conflicts when they bring it back inside the LAN. A document management system amplifies this by making it easier to have a local copy; In some DMSes, they differentiate between a download and a "check out", where the latter results in the file being locked; but this tends to breakdown anyway, because the download process is easier (doesn't require providing a reason) and is a more immediately obvious way to get the file.

Right now the only broadly useful tech solution to collaboration I can see is something that can be set remotely to communicate to other users that a file is being edited. Automated file locking can only work for those opening files over webdav connections; every other access method requires a conscious "lock" trigger. Of course in teams with great communication a tech solution isn't needed...

putt1ck avatar Dec 04 '17 12:12 putt1ck