Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[old/new/spaces] In ocis and oc10, REPORT request response differently #4712

Closed
amrita-shrestha opened this issue Sep 29, 2022 · 4 comments
Closed
Labels

Comments

@amrita-shrestha
Copy link
Contributor

Describe the bug

While searching for files | folder with REPORT method, different response comes in oc10 and ocis

  • d:getlastmodified date format is different in ocis and oc10
  • d:getetag is empty in ocis
  • oc:size , oc:owner-id, oc:owner-display-name absent in ocis
  • oc:name, d:resourcetype , d:getcontentlength, oc:score absent in oc10

Steps to reproduce

Steps to reproduce the behavior:

  1. As user admin create resources upload.txt, upload-folder, Documents/upload.txt
  2. Search for upload using old endpoint
curl -X REPORT -vk -u admin:admin http://host.docker.internal:8080/remote.php/webdav -d '<?xml version="1.0" encoding="UTF-8"?> <oc:search-files xmlns:a="DAV:" xmlns:oc="http://owncloud.org/ns"> <oc:search> <oc:pattern>upload</oc:pattern> </oc:search> <a:prop><oc:fileid/><oc:permissions/><a:getlastmodified/><a:getetag/><a:getcontenttype/><oc:size/><oc:owner-id/><oc:owner-display-name/> </a:prop> </oc:search-files>'|  xmllint --format -

Main difference

In oc10

<d:response>
    <d:href>/remote.php/webdav/upload.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>20</oc:fileid>
        <oc:permissions>RDNVW</oc:permissions>
        <d:getlastmodified>Thu, 29 Sep 2022 07:11:22 GMT</d:getlastmodified>
        <d:getetag>"8ee15636e55d81dff4fd937670897280"</d:getetag>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:size>10</oc:size>
        <oc:owner-id>admin</oc:owner-id>
        <oc:owner-display-name>admin</oc:owner-display-name>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>

In ocis

  <d:response>
    <d:href>/remote.php/dav/spaces/1284d238-aa92-42ce-bdc4-0b0000009157$some-admin-user-id-0000-000000000000/upload.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$some-admin-user-id-0000-000000000000!d9eda8df-636c-4ac6-b296-17887bb31cdc</oc:fileid>
        <oc:name>upload.txt</oc:name>
        <d:getlastmodified>2022-09-29T06:55:55Z</d:getlastmodified>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:permissions>RDNVW</oc:permissions>
        <d:getetag/>
        <d:resourcetype/>
        <d:getcontentlength>8</d:getcontentlength>
        <oc:score>1.0505919456481934</oc:score>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>

Question

  • Is different responses in oc10 and ocis actual behavior?

Detail

In oc10
 curl -X REPORT -vk -u admin:admin http://host.docker.internal:8080/remote.php/webdav -d '<?xml version="1.0" encoding="UTF-8"?> <oc:search-files xmlns:a="DAV:" xmlns:oc="http://owncloud.org/ns"> <oc:search> <oc:pattern>upload</oc:pattern> </oc:search> <a:prop><oc:fileid/><oc:permissions/><a:getlastmodified/><a:getetag/><a:getcontenttype/><oc:size/><oc:owner-id/><oc:owner-display-name/> </a:prop> </oc:search-files>'|  xmllint --format -
<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/remote.php/webdav/upload%20folder</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>21</oc:fileid>
        <oc:permissions>RDNVCK</oc:permissions>
        <d:getlastmodified>Thu, 29 Sep 2022 07:11:45 GMT</d:getlastmodified>
        <d:getetag>"63354531676b3"</d:getetag>
        <oc:size>0</oc:size>
        <oc:owner-id>admin</oc:owner-id>
        <oc:owner-display-name>admin</oc:owner-display-name>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <d:getcontenttype/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/webdav/upload%f0%9f%98%80%20%f0%9f%98%81</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>22</oc:fileid>
        <oc:permissions>RDNVCK</oc:permissions>
        <d:getlastmodified>Thu, 29 Sep 2022 07:12:02 GMT</d:getlastmodified>
        <d:getetag>"63354542c702b"</d:getetag>
        <oc:size>0</oc:size>
        <oc:owner-id>admin</oc:owner-id>
        <oc:owner-display-name>admin</oc:owner-display-name>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <d:getcontenttype/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/webdav/upload.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>20</oc:fileid>
        <oc:permissions>RDNVW</oc:permissions>
        <d:getlastmodified>Thu, 29 Sep 2022 07:11:22 GMT</d:getlastmodified>
        <d:getetag>"8ee15636e55d81dff4fd937670897280"</d:getetag>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:size>10</oc:size>
        <oc:owner-id>admin</oc:owner-id>
        <oc:owner-display-name>admin</oc:owner-display-name>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/webdav/Documents/upload.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>23</oc:fileid>
        <oc:permissions>RDNVW</oc:permissions>
        <d:getlastmodified>Thu, 29 Sep 2022 07:12:51 GMT</d:getlastmodified>
        <d:getetag>"44c649407adc16663767af6e14be43d6"</d:getetag>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:size>5</oc:size>
        <oc:owner-id>admin</oc:owner-id>
        <oc:owner-display-name>admin</oc:owner-display-name>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>
In Ocis
curl -X REPORT -vk -u admin:admin https://host.docker.internal:9200/remote.php/webdav -d '<?xml version="1.0" encoding="UTF-8"?> <oc:search-files xmlns:a="DAV:" xmlns:oc="http://owncloud.org/ns"> <oc:search> <oc:pattern>upload</oc:pattern> </oc:search> <a:prop><oc:fileid/><oc:permissions/><a:getlastmodified/><a:getetag/><a:getcontenttype/><oc:size/><oc:owner-id/><oc:owner-display-name/> </a:prop> </oc:search-files>'|  xmllint --format -

<?xml version="1.0"?>
<d:multistatus xmlns:s="http://sabredav.org/ns" xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/remote.php/dav/spaces/1284d238-aa92-42ce-bdc4-0b0000009157$some-admin-user-id-0000-000000000000/jus/upload%C3%9C%E0%A4%A0%E0%A4%BFF.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$some-admin-user-id-0000-000000000000!c91942ef-3400-49d5-a4ca-5f014c248a64</oc:fileid>
        <oc:name>upload&#xDC;&#x920;&#x93F;F.txt</oc:name>
        <d:getlastmodified>2022-09-29T06:57:21Z</d:getlastmodified>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:permissions>RDNVW</oc:permissions>
        <d:getetag/>
        <d:resourcetype/>
        <d:getcontentlength>16</d:getcontentlength>
        <oc:score>1.1530207395553589</oc:score>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/spaces/1284d238-aa92-42ce-bdc4-0b0000009157$some-admin-user-id-0000-000000000000/upload%F0%9F%98%80%20%F0%9F%98%81</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$some-admin-user-id-0000-000000000000!fff8e045-1628-4de9-bba7-1f5afc7601be</oc:fileid>
        <oc:name>upload&#x1F600; &#x1F601;</oc:name>
        <d:getlastmodified>2022-09-29T06:55:29Z</d:getlastmodified>
        <d:getcontenttype>httpd/unix-directory</d:getcontenttype>
        <oc:permissions>RDNVCK</oc:permissions>
        <d:getetag/>
        <d:resourcetype>
          <d:collection/>
        </d:resourcetype>
        <oc:size>0</oc:size>
        <oc:score>1.1044081449508667</oc:score>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/spaces/1284d238-aa92-42ce-bdc4-0b0000009157$some-admin-user-id-0000-000000000000/upload%20folder</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$some-admin-user-id-0000-000000000000!4672b6e7-296e-45aa-8e34-9047064d0567</oc:fileid>
        <oc:name>upload folder</oc:name>
        <d:getlastmodified>2022-09-29T06:56:31Z</d:getlastmodified>
        <d:getcontenttype>httpd/unix-directory</d:getcontenttype>
        <oc:permissions>RDNVCK</oc:permissions>
        <d:getetag/>
        <d:resourcetype>
          <d:collection/>
        </d:resourcetype>
        <oc:size>0</oc:size>
        <oc:score>1.1044081449508667</oc:score>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/spaces/1284d238-aa92-42ce-bdc4-0b0000009157$some-admin-user-id-0000-000000000000/upload.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$some-admin-user-id-0000-000000000000!d9eda8df-636c-4ac6-b296-17887bb31cdc</oc:fileid>
        <oc:name>upload.txt</oc:name>
        <d:getlastmodified>2022-09-29T06:55:55Z</d:getlastmodified>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:permissions>RDNVW</oc:permissions>
        <d:getetag/>
        <d:resourcetype/>
        <d:getcontentlength>8</d:getcontentlength>
        <oc:score>1.0505919456481934</oc:score>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>
@JammingBen
Copy link
Contributor

JammingBen commented Oct 26, 2022

We also noticed this in Web: owncloud/web#7780

Not only oCIS and oC10 seems to differ, but also the REPORT and PROPFIND requests in oCIS. Web expects responses from REPORT to be identical to PROPFIND (e.g. same date format for d:getlastmodified and oc:size , oc:owner-id, oc:owner-display-name to be present).

@nabim777
Copy link
Member

nabim777 commented Sep 27, 2023

The different response now appears in oc10(oc10.13.2) and ocis (4.0.0+261a527dfd)when searching for files and folders with the REPORT method.

for files

In OCI10 for files
<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/core/remote.php/webdav/upload.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>2147484333</oc:fileid>
        <oc:permissions>RDNVW</oc:permissions>
        <d:getlastmodified>Wed, 27 Sep 2023 06:45:15 GMT</d:getlastmodified>
        <d:getetag>"c05d28939126b204548392c0d47e89e0"</d:getetag>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:size>12</oc:size>
        <oc:owner-id>admin</oc:owner-id>
        <oc:owner-display-name>admin</oc:owner-display-name>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>
In OCIS for files
<d:multistatus xmlns:s="http://sabredav.org/ns" xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
    <d:response>
        <d:href>/remote.php/dav/spaces/db19f47e-f46a-485a-980a-96c9996b37ce$6be41e1b-338d-4d42-86d4-6444d779454e/upload.txt</d:href>
        <d:propstat>
            <d:prop>
                <oc:fileid>db19f47e-f46a-485a-980a-96c9996b37ce$6be41e1b-338d-4d42-86d4-6444d779454e!80f0ddce-5f9f-4f7a-a50c-c9bace6a8022</oc:fileid>
                <oc:file-parent>db19f47e-f46a-485a-980a-96c9996b37ce$6be41e1b-338d-4d42-86d4-6444d779454e!6be41e1b-338d-4d42-86d4-6444d779454e</oc:file-parent>
                <oc:name>upload.txt</oc:name>
                <d:getlastmodified>2023-09-27T07:03:27Z</d:getlastmodified>
                <d:getcontenttype>text/plain</d:getcontenttype>
                <oc:permissions>RDNVW</oc:permissions>
                <oc:highlights></oc:highlights>
                <oc:tags></oc:tags>
                <d:getetag></d:getetag>
                <d:resourcetype></d:resourcetype>
                <d:getcontentlength>35604</d:getcontentlength>
                <oc:score>3.9463601112365723</oc:score>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
    </d:response>
</d:multistatus>
Property OCIS OCI10
oc:fileid
oc:file-parent ✖️
oc:name ✖️
d:getlastmodified
d:getcontenttype
oc:permissions
oc:highlights ✖️
oc:tags ✖️
d:getetag
d:resourcetype ✖️
d:getcontentlength ✖️
oc:score ✖️
oc:owner-display-name ✖️
oc:owner-id ✖️
oc:size ✖️

for folders

In OCIS for folders
<d:multistatus xmlns:s="http://sabredav.org/ns" xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
    <d:response>
        <d:href>/remote.php/dav/spaces/db19f47e-f46a-485a-980a-96c9996b37ce$6be41e1b-338d-4d42-86d4-6444d779454e/folder</d:href>
        <d:propstat>
            <d:prop>
                <oc:fileid>db19f47e-f46a-485a-980a-96c9996b37ce$6be41e1b-338d-4d42-86d4-6444d779454e!945bb0a3-4bab-4532-a3a2-157e5c109eaf</oc:fileid>
                <oc:file-parent>db19f47e-f46a-485a-980a-96c9996b37ce$6be41e1b-338d-4d42-86d4-6444d779454e!6be41e1b-338d-4d42-86d4-6444d779454e</oc:file-parent>
                <oc:name>folder</oc:name>
                <d:getlastmodified>2023-09-28T04:58:39Z</d:getlastmodified>
                <d:getcontenttype>httpd/unix-directory</d:getcontenttype>
                <oc:permissions>RDNVCK</oc:permissions>
                <oc:highlights></oc:highlights>
                <oc:tags></oc:tags>
                <d:getetag></d:getetag>
                <d:resourcetype>
                    <d:collection/>
                </d:resourcetype>
                <oc:size>0</oc:size>
                <oc:score>1.8533624410629272</oc:score>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
    </d:response>
</d:multistatus>
In OC10 for folders
<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
    <d:response>
        <d:href>/core/remote.php/webdav/folder</d:href>
        <d:propstat>
            <d:prop>
                <oc:fileid>2147484338</oc:fileid>
                <oc:permissions>RDNVCK</oc:permissions>
                <d:getlastmodified>Thu, 28 Sep 2023 05:05:50 GMT</d:getlastmodified>
                <d:getetag>&quot;651509ae5853f&quot;</d:getetag>
                <oc:size>0</oc:size>
                <oc:owner-id>admin</oc:owner-id>
                <oc:owner-display-name>admin</oc:owner-display-name>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
        <d:propstat>
            <d:prop>
                <d:getcontenttype/>
            </d:prop>
            <d:status>HTTP/1.1 404 Not Found</d:status>
        </d:propstat>
    </d:response>
</d:multistatus>

In ocis while searching oc:size appears in folders but does not appear in files

Property OCIS OCI10
oc:fileid
oc:file-parent ✖️
oc:name ✖️
d:getlastmodified
d:getcontenttype ✖️
oc:permissions
oc:highlights ✖️
oc:tags ✖️
d:getetag
d:resourcetype ✖️
oc:score ✖️
oc:owner-display-name ✖️
oc:owner-id ✖️
oc:size

In OC10 and OCIS, the response value are different.
We have been using the test code from core where previously we made sure that oc10 and ocis gives the same response.
But since now the oCIS is quite a bit different from the oc10.
@phil-davis @ScharfViktor @saw-jan since this test is failed in oCIS and this failed scenarios are in expected to failure. If oCIS gives the same response then we can refactor the scenarios to make the test passing. if not then this issue will remain open.

@saw-jan
Copy link
Member

saw-jan commented Sep 27, 2023

I remember that the response was different between file and folder. could you also report what were the differences?

@saw-jan saw-jan closed this as completed Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants