Introduce Partial Delete: Improved remoteDelete propagation#9663
Open
vacy wants to merge 2 commits intonextcloud:masterfrom
Open
Introduce Partial Delete: Improved remoteDelete propagation#9663vacy wants to merge 2 commits intonextcloud:masterfrom
vacy wants to merge 2 commits intonextcloud:masterfrom
Conversation
Implements a safety mechanism to prevent dataloss when deleting folders
that contain selective sync exclusions.
When a folder containing unsynced descendants is deleted:
- Instead of deleting the whole folder on the server, only the synced
content is deleted - i.e. content the user was able to see.
- The folder itself and any unsynced content remains on the server.
- This preserves data that would otherwise be lost.
Changes:
- common/syncjournaldb.cpp:
- added hasSelectiveSyncDescendants() to check if a path
has unsynced descendants in the selective sync blacklist.
- added getSyncedDescendants() to get all synced items
within a folder path.
- libsync/propagateremotedelete.cpp: modified start() to detect when a folder
deletion would affect unsynced content. Implements partial deletion
mode that deletes synced items individually while preserving the
folder and unsynced content.
- libsync/owncloudpropagator.cpp: added selectiveSyncList management
Fixes nextcloud#6948
Signed-off-by: Jan-Florian Hilgenberg <florianhilgenberg@gmail.com>
8 tasks
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.
Summary
If a user deletes a folder, one would expect to delete only data that the user could've seen.
In case the deleted folder contains data, that was deselected for sync - thus user didnt see that - the desktop client would also delete that unseen data on the server.
I already had some discussion about a while ago in: #6948 and https://help.nextcloud.com/t/desktop-client-triggered-deletions-are-deleting-not-synced-data/199356
Comparison to competitors
Also compared this behavior to OneDrive and Dropbox. Both keep data on the server, because they assume the user has not seen it, thus does not want to delete that portion.
When would you face this problem?
You decided willingly to sync only part of the folder structure. You forget about it and delete the parent.
Syncengine decided automatically that a folder would be added to blacklist, you most likely do not know about that.
Yes the client notifies about it. But does it always? Notifications are also prone to alert fatigue.
I would also expect this problem, but that is not verified:
-> When data is incoming from your own account or a received share and the client is still downloading the data
-> You delete the folder and it deletes everything on the server, even data you didnt see yet and even data in a received share.
Changes
Implements a safety mechanism to prevent dataloss when deleting folders that contain selective sync exclusions.
When a folder containing unsynced descendants is deleted:
Changes:
common/syncjournaldb.cpp:
libsync/propagateremotedelete.cpp: modified start() to detect when a folder deletion would affect unsynced content. Implements partial deletion
mode that deletes synced items individually while preserving the
folder and unsynced content.
libsync/owncloudpropagator.cpp: added selectiveSyncList management
Fixes #6948