Skip to content

fix(file-provider): use slash prefix for child item queries.#10130

Draft
camilasan wants to merge 2 commits into
masterfrom
bugfix/fpext-slash-prefix-child-queries
Draft

fix(file-provider): use slash prefix for child item queries.#10130
camilasan wants to merge 2 commits into
masterfrom
bugfix/fpext-slash-prefix-child-queries

Conversation

@camilasan

@camilasan camilasan commented Jun 9, 2026

Copy link
Copy Markdown
Member

Resolves

Slash prefix in path queries — starts(with: directoryUrl) without a trailing slash incorrectly matched sibling directories that share a name prefix (e.g. photos matched photos-backup).

Summary

Renaming or deleting a folder could silently affect any sibling whose name begins with the same string — data in unrelated folders gets corrupted or deleted during sync.

Solution

Adding + "/" restricts matches to true descendants only.

Steps to test it

  1. Create FolderA and FolderA-old on the server, each with at least one file inside.
  2. Wait for both to appear in Finder.
  3. Rename FolderA → FolderA-renamed from the web UI or another client.
  4. Wait for sync to settle.
    ✅ FolderA-old and its contents must be untouched.
  5. Delete FolderA-renamed from the web UI.
    ✅ FolderA-old must still appear and remain accessible.

Checklist

AI (if applicable)

Appends "/" to directory URLs before prefix matching to prevent
"A/B" from incorrectly matching children of "A/BC".

Assisted-by: Claude:claude-sonnet-4-5
Signed-off-by: Camila Ayres <hello@camilasan.com>
@camilasan camilasan added this to the 4.0.11 milestone Jun 9, 2026
@camilasan camilasan added the bug label Jun 9, 2026
@camilasan

Copy link
Copy Markdown
Member Author

/backport to stable-33.0

@camilasan

Copy link
Copy Markdown
Member Author

/backport to stable-4.0

@camilasan camilasan marked this pull request as draft June 9, 2026 12:46
@camilasan camilasan force-pushed the bugfix/fpext-slash-prefix-child-queries branch from 119ceb1 to 431417c Compare June 9, 2026 13:03
Assisted-by: Claude:claude-sonnet-4-5
Signed-off-by: Camila Ayres <hello@camilasan.com>
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Artifact containing the AppImage: nextcloud-appimage-pr-10130.zip

Digest: sha256:c02923cf03c72852f172a0fe2161ec8a070c48eb32532a463482a641fe45fa55

To test this change/fix you can download the above artifact file, unzip it, and run it.

Please make sure to quit your existing Nextcloud app and backup your data.

@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant