owncloud / owncloud/ios-app

[BUG] File locking causes infinite request sending

Open
#770 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type:bug
Dominant language
Swift
Stars
251
Forks
142
Avg merge
2d 17h
Merged PRs (30d)
3

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue by locking a server file, then attempting to rename or move it in the iOS app. Trace the rename/move request handling and the server's 423 response; done means the operation stops without repeated requests and presents an error to the user. No source file or test is identified in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.