[stable-34.0] fix(libsync): folder move or rename data loss. - #10218
Merged
Conversation
- startsWith(deletedDir) without a trailing slash would match sibling directories sharing a common prefix (e.g. "A/B" matching "A/BC"), causing their journal records to be skipped in the failure-cleanup loop. Append '/' before the comparison. - Add test to cover removeRecursively sibling prefix guard. - Add isPathInsideDeletedDir as an inline header helper and a unit test verifying a sibling such as "A/BC" is not treated as a child of "A/B", guarding the journal cleanup after a failed local remove. Use qWarning instead of the deprecated QWARN in the testMovedWithError data rows. Assisted-by: Claude Code:claude-opus-4-8 Signed-off-by: Camila Ayres <[email protected]>
WebDAV lock tokens are bound to the URL they were issued for. When a parent directory is renamed, PropagateLocalRename and PropagateRemoteMove both copy child journal records to the new path while preserving the old token. Subsequent uploads send the stale token and receive 412/423 from the server. Clear the token from the journal on either status code so the next sync retries without it. Schedule rediscovery on 412 since the server state is uncertain. Force remote rediscovery on both 412 and 423 upload errors so the lock state cleared from the journal is refreshed from the server, not only the bad etag on 412. Strengthen the 412 test to assert the parent folder etag is invalidated. Add a matching Q_OS_WIN guard in testLockedStateClearedOnClientInitiatedRename to clear the ACL before the local directory rename, which Windows requires when files inside have an ACL-based read-only restriction. Assisted-by: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Camila Ayres <[email protected]>
When a remote directory move is finalized, iterate all children recorded in the sync journal and rewrite their paths to reflect the new location, clearing stale lock state. Without this, children retained the old path in the database and could be treated as new uploads or silently lost on the next sync cycle. Assisted-by: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Camila Ayres <[email protected]>
Signed-off-by: Camila Ayres <[email protected]>
Signed-off-by: Camila Ayres <[email protected]>
Signed-off-by: Camila Ayres <[email protected]>
Signed-off-by: Camila Ayres <[email protected]>
we might delete local client DB records when tracking server rename leading to loose of state by the client that will trigger wrong sync decisions Signed-off-by: Matthieu Gallien <[email protected]>
mgallien
approved these changes
Jun 22, 2026
mgallien
enabled auto-merge
June 22, 2026 09:17
Contributor
|
Artifact containing the AppImage: nextcloud-appimage-pr-10218.zip Digest: 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. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Backport of PR #9998