owncloud / ios-app

📱The all-new iOS app for ownCloud
https://owncloud.org/news/new-ios-app-ready-public-app-store/
GNU General Public License v3.0
214 stars 122 forks source link

[BUG] File locking causes infinite request sending #770

Open jesmrec opened 4 years ago

jesmrec commented 4 years ago

In a 10.5 server, enable file locking. This can be done with the following occ command:

occ config:app:set files enable_lock_file_action --value yes

Then, files in web UI will have a lock option that avoids the file to be displaced (moved, removed, renamed):

Screenshot 2020-08-04 at 17 34 29

Once it is locked, a lock icon appears in the cell:

Screenshot 2020-08-04 at 17 34 41

now, let's move to iOS

Steps to reproduce

  1. In server, lock a file following instructions above
  2. In iOS app, rename/move the file

Actual behaviour

This is not posible because file is locked. Server returns 423

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\Locked</s:exception>
  <s:message/>
  <d:lock-token-submitted>
    <d:href>files/user1/ownCloud Manual.pdf</d:href>
  </d:lock-token-submitted>
</d:error>

Expected behaviour

If the file is locked, it is not posible to rename/move it. It should show an error and the file is not renamed/moved.


In case of deletion of a locked file, there is no endless loop. Error is shown, but, it could be more friendly:

Screenshot 2020-08-04 at 17 47 51

iOS 13.6, iPhoneXR

michaelstingl commented 4 years ago

Locking behaviour needs to be coordinated across clients…