Skip to content

fix: return relative paths in search results - #170

Merged
DenizAltunkapan merged 3 commits into
Vault-Web:mainfrom
IhorHaidukov:bugfix/159-relative-search-path
Oct 9, 2026
Merged

DenizAltunkapan merged 3 commits into
Vault-Web:mainfrom
IhorHaidukov:bugfix/159-relative-search-path

Conversation

@IhorHaidukov

Copy link
Copy Markdown
Contributor

Summary

Return user-relative paths from folder search results instead of absolute host paths.

The search result path is now resolved within the user's root directory and converted to a normalized relative path.

Added a regression test to verify that paths such as Documents/report.txt are returned instead of absolute filesystem paths.

Linked issue

Closes #159

How to test

  • FolderServiceTest passes: 72 tests, 0 failures, 0 errors.
  • All searchInFolder tests pass.
  • Full backend test suite has one unrelated Windows symlink permission error in FileServiceTest.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agent review

The relative-path change itself looks right. One non-blocking robustness issue is in the inline comment: a symlink that resolves outside the user root can now make the whole search throw. There is no test for that case.

Generated by Pull Request Review for #170 · copilot · auto · 15.3 AIC · ⌖ 0.499 AIC · ⊞ 7.1K

Comment thread backend/src/main/java/cloudpage/service/FolderService.java Outdated
@DenizAltunkapan

Copy link
Copy Markdown
Member

@IhorHaidukov please fix the failing workflows

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agent review

One finding, inline. The relative path is computed against the real-path root, while the walked entries come from the unresolved root. If the root has a symlinked ancestor, the results contain ../ host-path fragments. Not necessarily merge-blocking, but it defeats the purpose of the fix. The existing symlink handling for #159 otherwise looks right.

Generated by Pull Request Review for #170 · copilot · auto · 15 AIC · ⌖ 0.504 AIC · ⊞ 7.1K

Comment thread backend/src/main/java/cloudpage/service/FolderService.java Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agent review

Suggestion: approve. I did not find any high-confidence correctness, security, regression, or missing-test issues in this diff.

Generated by Pull Request Review for #170 · copilot · auto · 16.3 AIC · ⌖ 0.495 AIC · ⊞ 7.1K

@DenizAltunkapan DenizAltunkapan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@IhorHaidukov Thanks!

@DenizAltunkapan
DenizAltunkapan merged commit 9da5df9 into Vault-Web:main Oct 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Security]: Return only user-relative paths from Cloud search results

2 participants