Closed Bug 1435145 Opened 7 years ago Closed 7 years ago

Handle children moved out of a deleted synced folder into a different subtree

Categories

(Firefox :: Sync, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 60
Tracking Status
firefox60 --- fixed

People

(Reporter: lina, Assigned: lina)

References

Details

Attachments

(1 file)

The fix for bug 1434800 is (embarrassingly :-) incomplete. It handles the case where a child moved out of a deleted folder and into a folder that we already walked, but not where a child moved into a different folder that we didn't walk yet.
Comment on attachment 8947707 [details] Bug 1435145 - Handle children moved out of a deleted synced folder into a different subtree. https://reviewboard.mozilla.org/r/217430/#review223176 ::: toolkit/components/places/SyncedBookmarksMirror.jsm:3308 (Diff revision 1) > - let locallyMovedOrDeleted = this.checkForLocalMoveOrDeletionOfRemoteNode( > - mergedNode, remoteChildNode); > - if (locallyMovedOrDeleted) { > + let structureChange = this.checkForLocalStructureChangeOfRemoteNode( > + mergedNode, remoteParentNode, remoteChildNode); > + if (structureChange == BookmarkMerger.STRUCTURE.DELETED) { > return true; > } > This is the important part: we still want to merge the child if it's *moved*, because the logic below this check decides where to keep it. I expanded the comment above this function to clarify that the two are separate cases. ::: toolkit/components/places/SyncedBookmarksMirror.jsm:3741 (Diff revision 1) > for (let remoteChildNode of remoteNode.children) { > - let locallyMovedOrDeleted = this.checkForLocalMoveOrDeletionOfRemoteNode( > - mergedNode, remoteChildNode); > - if (locallyMovedOrDeleted) { > - // The remote child doesn't exist locally, or is already moved or > - // deleted locally, so we can safely ignore it. > + let structureChange = this.checkForLocalStructureChangeOfRemoteNode( > + mergedNode, remoteNode, remoteChildNode); > + if (structureChange == BookmarkMerger.STRUCTURE.MOVED || > + structureChange == BookmarkMerger.STRUCTURE.DELETED) { > + // The remote child is already moved or deleted locally, so we should Here, however, the child can be moved or deleted, and both should stop us from treating it as an orphan.
Comment on attachment 8947707 [details] Bug 1435145 - Handle children moved out of a deleted synced folder into a different subtree. https://reviewboard.mozilla.org/r/217430/#review223184
Attachment #8947707 - Flags: review?(markh) → review+
Pushed by kcambridge@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9ffe77b5c891 Handle children moved out of a deleted synced folder into a different subtree. r=markh
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: