nextcloud / nextcloud/files_lock

Allow WebDAV PROPPATCH to Change the Favourite Status of Locked Files

Open
#68 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage enhancement
Dominant language
JavaScript
Stars
39
Forks
10
Avg merge
1d 11h
Merged PRs (30d)
48

Description

Related

#27:

  • (+) keep a possibility to add locked file to favorites

Steps

  1. Lock admin/Nextcloud Manual.pdf
  2. Use WebDAV to change the favourite status, see logs

Expected

Changing the favourite should still be possible using WebDAV.
The web UI uses POST /apps/files/api/v1/files/Nextcloud%20Manual.pdf to change the favourite tag which still works as expected.

Actual

423: Sabre\DAV\Exception\Locked, see logs

Logs:

[Request]: PROPPATCH http://localhost:8080/remote.php/dav/files/admin/Nextcloud%20Manual.pdf
    [Headers]:
        Authorization: Basic YWRtaW46cmlZemFUZzYyS2tZdzF0NXg3RmRyd3VYd1Y1VkxNU2s4ZDgxQ05UVEVFanBxb0h4Y0hGT09CSE8wMXBpUVpBWExNM1YwaEdP
        Content-Type: application/x-www-form-urlencoded
        OCS-APIRequest: true
        User-Agent: Mozilla/5.0 (iOS) Nextcloud-iOS/4.4.0
    [Body]: 
        <?xml version="1.0"?>
        <d:propertyupdate xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
            <d:set>
                <d:prop>
                    <oc:favorite>1</oc:favorite>
                </d:prop>
            </d:set>
        </d:propertyupdate>
[Response]:
    [Status Code]: 423
    [Headers]:
        Cache-Control: no-store, no-cache, must-revalidate
        Connection: Keep-Alive
        Content-Length: 288
        Content-Security-Policy: default-src 'none';
        Content-Type: application/xml; charset=utf-8
        Date: Mon, 02 May 2022 12:36:09 GMT
        Expires: Thu, 19 Nov 1981 08:52:00 GMT
        Keep-Alive: timeout=5, max=99
        Pragma: no-cache
        Referrer-Policy: no-referrer
        Server: Apache/2.4.53 (Debian)
        X-Content-Type-Options: nosniff
        X-Frame-Options: SAMEORIGIN
        X-Permitted-Cross-Domain-Policies: none
        X-Powered-By: PHP/8.0.18
        X-Robots-Tag: none
        X-XSS-Protection: 1; mode=block
    [Body]:
        <?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/admin/Nextcloud Manual.pdf</d:href>
          </d:lock-token-submitted>
        </d:error>

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

Start by tracing the WebDAV PROPPATCH handling for the oc:favorite property and compare it with the working POST /apps/files/api/v1/files/Nextcloud%20Manual.pdf endpoint. Reproduce the lock and PROPPATCH request from the issue; done means a locked file's favourite status changes through WebDAV without removing the 423 lock protection.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.