Skip to content

[full-ci] fix: [OCISDEV-330] limit search only when scope is passed#11664

Merged
LukasHirt merged 1 commit intomasterfrom
fix/search-scope
Sep 24, 2025
Merged

[full-ci] fix: [OCISDEV-330] limit search only when scope is passed#11664
LukasHirt merged 1 commit intomasterfrom
fix/search-scope

Conversation

@LukasHirt
Copy link
Copy Markdown
Contributor

@LukasHirt LukasHirt commented Sep 17, 2025

Description

Previously, the search service would limit the search to the according space when searching /dav/spaces/. This was not correct, as the search should be limited to the according space when a scope is passed in the search pattern instead.

Motivation and Context

Search behaviour is not dependent on remote.php.

Related issues

How Has This Been Tested?

  • test environment: macos, chrome
  • test case 1: search for folders with same name globally
  • test case 2: search for folders with same name with scope

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

@LukasHirt LukasHirt force-pushed the fix/search-scope branch 3 times, most recently from b0d555f to 1f682d4 Compare September 17, 2025 10:21
@LukasHirt
Copy link
Copy Markdown
Contributor Author

A lot of tests related to public links are failing. Not sure why those are affected but maybe it's due to the changed href. If we update Reva to get owncloud/reva#390 in here, I think they might pass again.

Bugfix: Limit search only when scope is passed

Previously, the search service would limit the search to the according space when searching `/dav/spaces/`.
This was not correct, as the search should be limited to the according space when a `scope` is passed in the search pattern instead.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are we already doing this? Or are we taking away the ability to search in spaces for now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, scope is already working

query, scope := ParseScope(req.Query)

Also tested locally to verify this and works as expected.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok 👍 We should still double check with clients. As far as I understand we are taking away the possibility to filter the space via URL, correct? This could break client behaviour if they filter like this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@DeepDiver1975 can you please let us know if we would break clients with this change? The topic is: searching for resources using /dav/spaces/* endpoint to limit results to a specific space instead of using scope in the search pattern.

@kobergj even if clients wouldn't be affected, should we change this then from enhancement to change to mark a breaking change? I kind of dislike bumping the major version to 8 just because of this... alternative is of course to adjust the behaviour to checking if there is actually the space ID passed in the endpoint and only limit it in such cases instead of completely dropping it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

alternative is of course to adjust the behaviour to checking if there is actually the space ID passed in the endpoint and only limit it in such cases instead of completely dropping it

Isn't that already the case? When no spaceid is giving, parsing of the spaceID would fail, which leads to a debug level log. But the request will not get limited in that case.

Copy link
Copy Markdown
Contributor Author

@LukasHirt LukasHirt Sep 23, 2025

Choose a reason for hiding this comment

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

Is that happening in some different place? The change would drop it in this specific function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Clarified in chat, no breaking change needed and clients are not using this. We should be good to go.

@LukasHirt
Copy link
Copy Markdown
Contributor Author

@kobergj any idea about the sonarcloud issue? What annotation does it want? :D

Previously, the search service would limit the search
to the according space when searching `/dav/spaces/`.
This was not correct, as the search should be limited
to the according space when a `scope` is passed in the search pattern instead.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Sep 24, 2025

@kobergj
Copy link
Copy Markdown
Collaborator

kobergj commented Sep 24, 2025

It wanted an xml tag on the struct that is xml parsed. This makes sense but since you didn't touch it it is not relevant for this PR

@LukasHirt LukasHirt merged commit 4689ab0 into master Sep 24, 2025
4 checks passed
@LukasHirt LukasHirt deleted the fix/search-scope branch September 24, 2025 11:05
ownclouders pushed a commit that referenced this pull request Sep 24, 2025
[full-ci] fix: [OCISDEV-330] limit search only when scope is passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REPORT request without remote.php returns empty result (only with dav/spaces path)

3 participants