-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Do not mark undefined remote as trashed (#2372)
When merging the trashing of a document, we add a `trashed` marker in its metadata for the side on which it was trashed (e.g. in the `remote` attribute if the document was trashed on the Cozy) as well as its global metadata. However, when a directory is trashed, we also mark all its children and these might not have been synchronized yet and the trashed side metadata can be missing. e.g. given we have the synchronized directory `dir/` and a local only file `dir/file`, when merging the trashing of `dir/` on the Cozy we: 1. mark `dir/` as trashed and its `remote` attribute 2. try to do the same for `dir/file` but it has no `remote` attribute, only a `local` one We were not checking for the presence of the `remote` attribute and in this case we would end up with an error while trying to mark `dir/file` as we'd try to add a `trashed` attribute on `undefined` (i.e. the missing `remote` attribute). By checking for the presence of the `remote` attribute we make sure we don't get this error and don't block the synchronization of the parent directory trashing. The child will still be removed with its parent.
- Loading branch information
1 parent
e8f342e
commit 59b2db1
Showing
3 changed files
with
105 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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