@@ -487,18 +487,47 @@ export default class SyncProcess {
487487 localScanner = new Scanner (
488488 this . cacheTreeRoot ,
489489 this . localTreeRoot ,
490- ( oldItem , newItem ) =>
491- ( oldItem . type === newItem . type && String ( oldItem . id ) === String ( newItem . id ) ) ,
490+ ( oldItem , newItem ) => {
491+ if ( oldItem . type !== newItem . type ) {
492+ return false
493+ }
494+ if ( oldItem . type === 'folder' ) {
495+ if ( String ( oldItem . id ) === String ( newItem . id ) ) {
496+ return true
497+ }
498+ }
499+ if ( oldItem . type === 'bookmark' && newItem . type === 'bookmark' ) {
500+ if ( String ( oldItem . id ) === String ( newItem . id ) && oldItem . url === newItem . url ) {
501+ return true
502+ }
503+ }
504+ return false
505+ } ,
492506 this . preserveOrder
493507 )
494508 serverScanner = new Scanner (
495509 this . cacheTreeRoot ,
496510 this . serverTreeRoot ,
497511 // We also allow canMergeWith here, because e.g. for NextcloudFolders the id of moved bookmarks changes (because their id is "<bookmarkID>;<folderId>")
498512 ( oldItem , newItem ) => {
499- if ( ( oldItem . type === newItem . type && Mappings . mappable ( mappingsSnapshot , oldItem , newItem ) ) || ( oldItem . type === 'bookmark' && oldItem . canMergeWith ( newItem ) ) ) {
500- newMappings . push ( [ oldItem , newItem ] )
501- return true
513+ if ( oldItem . type !== newItem . type ) {
514+ return false
515+ }
516+ if ( oldItem . type === 'folder' ) {
517+ if ( Mappings . mappable ( mappingsSnapshot , oldItem , newItem ) ) {
518+ newMappings . push ( [ oldItem , newItem ] )
519+ return true
520+ }
521+ }
522+ if ( oldItem . type === 'bookmark' && newItem . type === 'bookmark' ) {
523+ if ( Mappings . mappable ( mappingsSnapshot , oldItem , newItem ) && oldItem . url === newItem . url ) {
524+ newMappings . push ( [ oldItem , newItem ] )
525+ return true
526+ }
527+ if ( oldItem . canMergeWith ( newItem ) ) {
528+ newMappings . push ( [ oldItem , newItem ] )
529+ return true
530+ }
502531 }
503532 return false
504533 } ,
@@ -882,7 +911,6 @@ export default class SyncProcess {
882911 }
883912
884913 if ( action . payload instanceof Folder && action . payload . children . length && action . oldItem instanceof Folder ) {
885-
886914 // Fix for Unidirectional reverted REMOVEs, for all other strategies this should be a noop
887915 action . payload . children . forEach ( ( item ) => {
888916 item . parentId = id
0 commit comments