Skip to content

Conversation

@claucambra
Copy link
Contributor

From my notes on the issue:

  • Checking into bug where on second page of paginated enumeration, folders are identified as files
    • It's a server bug.
<d:multistatus
    xmlns:d="DAV:"
    xmlns:s="http://sabredav.org/ns"
    xmlns:oc="http://owncloud.org/ns"
    xmlns:nc="http://nextcloud.org/ns">
    <d:response>
        <d:href>/remote.php/dav/files/admin/</d:href>
        <d:propstat>
            <d:prop>
                <d:displayname>admin</d:displayname>
                <d:resourcetype>
                    <d:collection/>
                </d:resourcetype>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
    </d:response>
    <d:response>
        <d:href>/remote.php/dav/files/admin/Media/</d:href>
        <d:propstat>
            <d:prop>
                <d:displayname>Media</d:displayname>
                <d:resourcetype>
                    <d:collection/>
                </d:resourcetype>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
    </d:response>
</d:multistatus>


<d:multistatus
    xmlns:d="DAV:"
    xmlns:s="http://sabredav.org/ns"
    xmlns:oc="http://owncloud.org/ns"
    xmlns:nc="http://nextcloud.org/ns">
    <d:response>
        <d:href>/remote.php/dav/files/admin/Nextcloud_Server_Administration_Manual.pdf</d:href>
        <d:propstat>
            <d:prop>
                <d:displayname>Nextcloud_Server_Administration_Manual.pdf</d:displayname>
                <d:resourcetype/>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
    </d:response>
    <d:response>
        <d:href>/remote.php/dav/files/admin/Templates/</d:href>
        <d:propstat>
            <d:prop>
                <d:displayname>Templates</d:displayname>
                <d:resourcetype/>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
    </d:response>
</d:multistatus>
  • First block is page 0, second block is page 1
    • The templates item is a folder. No resourcetype info on it.
    • NextcloudKit only sets the directory property on an NKFile to true if this property is present and matching collection for the resourcetype (like in the first block)
  • Started work on checking for working set changes in RemoteChangeObserver

curl calls:

curl -X PROPFIND -H "Depth: 1" -H "X-NC-Paginate: true" -H "X-NC-Paginate-Count: 2" -u "admin:admin" -i --data '<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:">
  <d:prop>
    <d:displayname /><d:resourcetype />
  </d:prop>
</d:propfind>' "nextcloud.local/remote.php/dav/files/admin/"
curl -X PROPFIND -H "Depth: 1" -H "X-NC-Paginate: true" -H "X-NC-Paginate-Count: 2"  -u "admin:admin" -i --data '<?xml version="1.0"?>
<d:propfind xmlns:d="DAV:">
  <d:prop>
    <d:displayname /><d:resourcetype />
  </d:prop>
</d:propfind>' "nextcloud.local/remote.php/dav/files/admin/"

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
@claucambra claucambra requested a review from Copilot June 17, 2025 09:28
@claucambra claucambra self-assigned this Jun 17, 2025
@claucambra claucambra added this to the 3.0 milestone Jun 17, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new test to verify that directories are correctly recognized in a paginated file enumeration, addressing a server bug where folders are misclassified as files.

  • Adds a new boolean flag on test items (using i % 5 == 0) to indicate directories
  • Introduces assertions to confirm the correct count and ordering of folder-type items

@claucambra claucambra merged commit 9015a53 into main Jun 17, 2025
2 checks passed
@claucambra claucambra deleted the bugfix/verify-server-pages-folders-broken branch June 17, 2025 10:56
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

Successfully merging this pull request may close these issues.

2 participants