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] No response from server while searching inside a folder containing space in name #7114

Closed
grgprarup opened this issue Aug 24, 2023 · 13 comments
Assignees
Labels

Comments

@grgprarup
Copy link
Contributor

grgprarup commented Aug 24, 2023

Describe the bug

The server response is empty when the file is searched inside a current folder if the parent folder name has whitespace character in it.

Steps to reproduce

Steps to reproduce the behavior:

  1. As user einstein, Create a folder New Folder
  2. Create a file file1.txt in the root and inside of New Folder
  3. Search for the keyword file from inside the New Folder

Expected behavior

Must return a list of files.

Actual behavior

Payload
<?xml version="1.0"?>
<oc:search-files  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
  <d:prop>
    <oc:permissions />
    <oc:favorite />
    <oc:fileid />
    <oc:file-parent />
    <oc:name />
    <oc:owner-id />
    <oc:owner-display-name />
    <oc:shareid />
    <oc:shareroot />
    <oc:share-types />
    <oc:privatelink />
    <d:getcontentlength />
    <oc:size />
    <d:getlastmodified />
    <d:getetag />
    <d:getcontenttype />
    <d:resourcetype />
    <oc:downloadURL />
    <oc:tags />
  </d:prop>
  <oc:search>
    <oc:pattern>file scope:f42859af-f142-4691-97e2-9ba377d61acd$4c510ada-c86b-4815-8820-42cdf82c3d51/New folder</oc:pattern>
    <oc:limit>8</oc:limit>
  </oc:search>
</oc:search-files>
Response
<d:multistatus xmlns:s="http://sabredav.org/ns" xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"></d:multistatus>

Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.

OCIS_version= 3.1.0-rc.1, 4.0.0-rc.1
@grgprarup grgprarup changed the title [search] No response from server when searching inside folder [search] No response from server while searching inside folder Aug 24, 2023
@grgprarup grgprarup mentioned this issue Aug 24, 2023
68 tasks
@saw-jan saw-jan changed the title [search] No response from server while searching inside folder [search] No response from server while searching inside a folder containing space in name Aug 24, 2023
@individual-it
Copy link
Member

@grgprarup is the problem if the name contains the string "space" or if the name contains a space character " "?

@grgprarup
Copy link
Contributor Author

@grgprarup is the problem if the name contains the string "space" or if the name contains a space character " "?

its the space character " ", e.g. New Folder, Sample Folder

@hodyroff
Copy link
Contributor

It seems that when I switch to "all folders" it works. Therefor easy workaround, not a blocker.
To be fixed ASAP.

@fschade
Copy link
Contributor

fschade commented Aug 24, 2023

<oc:pattern>aa scope:44df7993-16c0-4159-a6de-6f5aacb4dc50$9959421d-a0e9-4013-bbb8-7f0f539923b7/Neuer Ordner</oc:pattern>

scope looks fishy to me, i have a look

@fschade
Copy link
Contributor

fschade commented Aug 24, 2023

cc: @2403905 looks like a scope issue, should I check or do you take over

@fschade
Copy link
Contributor

fschade commented Aug 24, 2023

its the whitespace character:

Entry("When scope contains whitespace",
  `scope:<uuid>/new folder/subfolder file`,
  `file`,
  `<uuid>/new folder/subfolder`,
),

regex: scope:\s*([^" "\n\r]*)

it cannot handle the whitespace... which is hard.... how to detect if file is part of the path or a dedicated query token on its own.... let us discuss this in zoom

@dj4oC
Copy link
Contributor

dj4oC commented Aug 24, 2023

IMHO annoying bug but no release blocker

@fschade
Copy link
Contributor

fschade commented Aug 24, 2023

will be fixed in the next release, i take this as a test item for the kql story, we have to quote it!

@fschade
Copy link
Contributor

fschade commented Aug 24, 2023

✅ for the kql version: 5dc8d3f

@tbsbdr tbsbdr added the Priority:p3-medium Normal priority label Aug 24, 2023
@grgprarup
Copy link
Contributor Author

grgprarup commented Aug 25, 2023

Test Coverage:

@2403905 2403905 self-assigned this Aug 25, 2023
@2403905
Copy link
Contributor

2403905 commented Aug 25, 2023

cc: @2403905 looks like a scope issue, should I check or do you take over

I'll take the issue. I'm not sure that kql will help solve the problem because we have to use the scope before we call the search API and parse the query string to kql ast.
@fschade FYI

@2403905
Copy link
Contributor

2403905 commented Aug 28, 2023

@janackermann Can we wrap the scope value in the double quotes and escape the quote characters in the middle of the path like the \" or ""?
scope:"<uuid>/folder/sub folder/book \"Bob's stories\"" or scope:"<uuid>/folder/sub folder/book ""Bob's stories"""

@ScharfViktor
Copy link
Contributor

I guess the issue can be closed.

using resourceID in scope solved issue

before: <oc:pattern>file scope:f42859af-f142-4691-97e2-9ba377d61acd$4c510ada-c86b-4815-8820-42cdf82c3d51/New folder</oc:pattern>

now: <oc:pattern>name:&quot;*file*&quot; scope:e49de8ab-e3c5-43dc-b83e-6337e680ae7c$96a25d9d-e174-4af1-90d1-e94c8a165401!9a1c05ac-0956-4592-86db-79d8ae311010</oc:pattern>

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

8 participants