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

Search request with scope and empty term fails with http 500 #7812

Closed
kulmann opened this issue Nov 27, 2023 · 6 comments · Fixed by #7815
Closed

Search request with scope and empty term fails with http 500 #7812

kulmann opened this issue Nov 27, 2023 · 6 comments · Fixed by #7815
Assignees
Labels

Comments

@kulmann
Copy link
Member

kulmann commented Nov 27, 2023

Describe the bug

Upon debugging owncloud/web#9970 we found out, that:

  1. a search query without term, with some filter (e.g. mediatype) and without scope works ✅
  2. a search query without term, with some filter (e.g. mediatype) and with scope doesn't work 💥

Steps to reproduce

  1. Do a REPORT on /remote.php/dav/spaces with a search pattern like this (scope:... AND mediatype:...).
<oc:pattern>scope:05828167-cf1b-4ea3-b5aa-3159e1b96a60$9e474e92-51ef-48c6-a75b-d12db7a99355!59185db9-8d7f-4aa9-b162-0b8ca8fd7c67 AND mediatype:(&quot;document&quot;)</oc:pattern>

Expected behavior

Like with a search request without the scope I'd expect to have a valid search response.

Actual behavior

http 500 💥

Setup

ownCloud Web UI 8.0.0-alpha.10
Infinite Scale 5.0.0-alpha.3+ed46fa914 Community
@kulmann kulmann moved this from Qualification to Prio 3 or less in Infinite Scale Team Board Nov 27, 2023
@kulmann
Copy link
Member Author

kulmann commented Nov 27, 2023

@tbsbdr @micbar p3 fine or different priority?

@2403905
Copy link
Contributor

2403905 commented Nov 27, 2023

The error happens because the scope looks like a Property but it is not a part of the search KQL expression. We extract the scope in the beginning of the search service.go#L97
And the KQL expression becomes AND mediatype:(&quot;document&quot;) with is invalid.
The response need to be fixed, it should be changed to 400.
Please use scope at the beginning or at the end of the search query and omit AND.

@2403905 2403905 mentioned this issue Nov 27, 2023
9 tasks
@2403905 2403905 self-assigned this Nov 28, 2023
@2403905 2403905 moved this from Prio 3 or less to In progress in Infinite Scale Team Board Nov 28, 2023
@2403905
Copy link
Contributor

2403905 commented Nov 28, 2023

The error happens because the scope looks like a Property but it is not a part of the search KQL expression. We extract the scope in the beginning of the search service.go#L97 And the KQL expression becomes AND mediatype:(&quot;document&quot;) with is invalid. The response need to be fixed, it should be changed to 400. Please use scope at the beginning or at the end of the search query and omit AND.

@kulmann Are you okay with it or do I need to rework it?

@kulmann
Copy link
Member Author

kulmann commented Nov 28, 2023

@kulmann Are you okay with it or do I need to rework it?

Sounds good to me - asked in the web issue if the dev who's working on it could try that out. Will come back with feedback as soon as it was tested. :-)

@micbar
Copy link
Contributor

micbar commented Dec 8, 2023

@2403905 was that fixed already?

@kulmann
Copy link
Member Author

kulmann commented Dec 8, 2023

There was no fix necessary in ocis. Web fixed the search behaviour using what's already there in the backend 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants