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

[Spaces dav path] Empty search result for sharee when searched using tag #6669

Closed
nabim777 opened this issue Jun 29, 2023 · 6 comments
Closed
Labels

Comments

@nabim777
Copy link
Member

nabim777 commented Jun 29, 2023

Describe the bug

When sharee searches for resources using tag then the response doesn't return any resources for spaces dav path version. But works fine for old and new dav path versions.

Steps to reproduce

Steps to reproduce the behavior:

  1. As einstein, create a file (folder) test.txt
  2. As einstein, assign tag tag1 to test.txt (Or assign tag by sharee)
  3. As einstein, share a file test.txt to user marie
  4. As marie, accept the incoming share
  5. As marie, search resources using Tags:tag1 through API
curl -kv -XREPORT https://localhost:9200/dav/spaces/<space-id> \
-u marie:radioactivity \
-d "<?xml version='1.0' encoding='utf-8' ?>
<oc:search-files xmlns:a='DAV:' xmlns:oc='http://owncloud.org/ns' >
<oc:search>
<oc:pattern>Tags:tag1</oc:pattern>
</oc:search>
</oc:search-files>" 

Expected behavior

The response of search should have resources having tag tag1.

Response for new dav path version
REPORT /remote.php/dav/files/Brian HTTP/1.1
> Host: localhost:9200
> Authorization: Basic YnJpYW46MTIzNA==
> User-Agent: curl/7.81.0
> Accept: */*
> Content-Length: 195
> Content-Type: application/x-www-form-urlencoded
> 
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* Mark bundle as not supporting multiuse
< HTTP/1.1 207 Multi-Status
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate, value
< Content-Range: rows 0-1/2
< Content-Security-Policy: frame-ancestors 'none'
< Content-Type: application/xml; charset=utf-8
< Date: Thu, 29 Jun 2023 07:18:21 GMT
< Dav: 1, 3, extended-mkcol
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Last-Modified: Thu, 29 Jun 2023 07:18:21 GMT
< Vary: Origin
< X-Content-Type-Options: nosniff
< X-Frame-Options: DENY
< X-Webdav-Version: 3.1.0-next.2+19b488704f
< Transfer-Encoding: chunked
< 
* TLSv1.2 (IN), TLS header, Supplemental data (23):

<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/a0ca6a90-a365-4782-871e-d44447bbc668%2134b45070-c186-42fb-8211-dd298a474304:57c3bf3e-de70-444e-87a6-18541711ff1f:a9ede403-7fdb-41de-9780-9b043df3d9f1/file1.txt</d:href>
		<d:propstat>
			<d:prop>
				<oc:fileid>34b45070-c186-42fb-8211-dd298a474304$57c3bf3e-de70-444e-87a6-18541711ff1f!70249964-50d8-4279-bd8b-e3e24cbe2499</oc:fileid>
				<oc:file-parent>34b45070-c186-42fb-8211-dd298a474304$57c3bf3e-de70-444e-87a6-18541711ff1f!3f7fdb4d-4efe-40a8-9ba1-1ae2562f3a01</oc:file-parent>
				<oc:shareid>34b45070-c186-42fb-8211-dd298a474304:57c3bf3e-de70-444e-87a6-18541711ff1f:a9ede403-7fdb-41de-9780-9b043df3d9f1</oc:shareid>
				<oc:shareroot>/uploadFolder</oc:shareroot>
				<oc:name>test.txt</oc:name>
				<d:getlastmodified>2023-06-29T06:20:28Z</d:getlastmodified>
				<d:getcontenttype>text/plain</d:getcontenttype>
				<oc:permissions>SRDNVW</oc:permissions>
				<oc:highlights></oc:highlights>
				<oc:tags>tag1</oc:tags>
				<d:getetag></d:getetag>
				<d:resourcetype></d:resourcetype>
				<d:getcontentlength>11</d:getcontentlength>
				<oc:score>6.258915901184082</oc:score>
			</d:prop>
			<d:status>HTTP/1.1 200 OK</d:status>
		</d:propstat>
	</d:response>
</d:multistatus>   

Actual behavior

The response of the search is empty.

Response for spaces dav path version
REPORT /dav/spaces/34b45070-c186-42fb-8211-dd298a474304$aa82ad17-d0bf-46bc-999d-3dde6dcd14a5 HTTP/1.1
Host: localhost:9200
User-Agent: GuzzleHttp/7
Authorization: Basic QnJpYW46MTIzNA==
Content-Length: 195


<?xml version='1.0' encoding='utf-8' ?>
<oc:search-files
	xmlns:a='DAV:'
	xmlns:oc='http://owncloud.org/ns' >
	<oc:search>
		<oc:pattern>Tags:tag1</oc:pattern>
	</oc:search>
</oc:search-files>HTTP/1.1 207 Multi-Status
Cache-Control: no-cache, no-store, max-age=0, must-revalidate, value
Content-Length: 113
Content-Security-Policy: frame-ancestors 'none'
Content-Type: application/xml; charset=utf-8
Date: Thu, 29 Jun 2023 08:45:40 GMT
Dav: 1, 3, extended-mkcol
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Last-Modified: Thu, 29 Jun 2023 08:45:40 GMT
Vary: Origin
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Webdav-Version: 3.1.0-next.2+19b488704f


<d:multistatus
	xmlns:s="http://sabredav.org/ns"
	xmlns:d="DAV:"
	xmlns:oc="http://owncloud.org/ns">
</d:multistatus>
@ScharfViktor
Copy link
Contributor

ScharfViktor commented Aug 1, 2023

I'm not sure that steps are correct
I think that for searching files in project space we should not use /dav/spaces/ProjectSpaceUUID. instead of that we should set location in body <oc:pattern>+Name:*find* scope:7821666e-dd94-440b-b77e-b5f241454024$f8d38bca-75a4-4591-9b3e-c961605fa992</oc:pattern>

please try as Marie:

curl -kv -XREPORT https://localhost:9200/dav/spaces/<Marie-personal-space-id> \
-u marie:radioactivity \
-d "<?xml version='1.0' encoding='utf-8' ?>
<oc:search-files xmlns:a='DAV:' xmlns:oc='http://owncloud.org/ns' >
<oc:search>
<oc:pattern>Tags:tag1 scope:ProjectSpaceUUID</oc:pattern>
</oc:search>
</oc:search-files>" 

@nabim777
Copy link
Member Author

nabim777 commented Aug 2, 2023

When we use Marie's personal-space-id here in curl -kv -XREPORT https://localhost:9200/dav/spaces/<Marie-personal-space-id>
the search result list will contain the files present in personal only it does not search globally.
Similarly, when we use project-space-id it will show the project spaces files only
But when we use share-space-id the search result will be zero
And
When we use endpoint https://localhost:9200/dav/spaces it will do global search
screenshot from Postman:
Screenshot from 2023-08-02 14-37-34

@ScharfViktor
Copy link
Contributor

I can't confirm that. works fine to me:
Screenshot 2023-08-02 at 11 25 47

@ScharfViktor
Copy link
Contributor

if I filter by location I get:
Screenshot 2023-08-02 at 11 32 04

@ScharfViktor
Copy link
Contributor

regarding search by tag using space dav.
here is my request:
Screenshot 2023-08-02 at 11 46 19

@nabim777
Copy link
Member Author

nabim777 commented Aug 3, 2023

After including remote.php in the endpoint it works fine but
the endpoint has to work when remote.php is not included so I have made a new issues #6954.
And closing this issue.

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

2 participants