-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desktop,Mobile,Cli: Fixes #11017: Delete revisions on the sync target when deleted locally #11035
Desktop,Mobile,Cli: Fixes #11017: Delete revisions on the sync target when deleted locally #11035
Conversation
…nc target when deleted locally
The diff is a bit hard to follow. Do you know what was special about revisions which means that they wouldn't be deleted after sync? |
From what I understand, there were no deleted_items table entries created when deleting the revisions. But the new call to this.batchDelete will create some on all sync sources. I don't follow what all the other changes are for though |
That's correct! The other changes include:
|
Currently, this is done by loading the original item (with This could be problematic: If the original item doesn't exist (e.g. not downloaded yet or permanently deleted), then the revisions can be deleted anyway. I'm not sure how to prevent this — would checking if the parent folder for the revisions is part of a read-only share (with Update: Answered here. |
Summary
This pull request fixes #11017 — previously, old revisions would remain on the sync target, even after being deleted locally. It seems that these deleted revisions could also be downloaded on sync soon after being deleted.
Testing plan
Manual testing: I've done only limited manual regression testing:
Automated testing: This pull request adds new automated tests:
'should delete old revisions remotely when deleted locally'
: Verifies that revision deletions sync between clients and that new clients don't download deleted revisions.'should not error on revisions for missing (not downloaded yet/permanently deleted) notes'
: Verifies that old revisions are correctly deleted even if the corresponding item no longer exists.