@@ -437,7 +437,10 @@ export default class SyncProcess {
437437 this . planStage3Server = {
438438 CREATE : this . serverPlanStage2 . CREATE ,
439439 UPDATE : this . serverPlanStage2 . UPDATE ,
440- MOVE : this . serverPlanStage2 . MOVE . map ( mappingsSnapshot , ItemLocation . SERVER ) ,
440+ // skipErroneousActions: a MOVE whose item can no longer be mapped to the target is
441+ // unapplyable; drop it instead of throwing MappingFailureError (which would force a
442+ // cache reset + from-scratch resync that duplicates on non-atomic servers).
443+ MOVE : this . serverPlanStage2 . MOVE . map ( mappingsSnapshot , ItemLocation . SERVER , ( ) => true , true ) ,
441444 REMOVE : this . serverPlanStage2 . REMOVE ,
442445 REORDER : this . serverPlanStage2 . REORDER ,
443446 }
@@ -471,7 +474,8 @@ export default class SyncProcess {
471474 this . planStage3Local = {
472475 CREATE : this . localPlanStage2 . CREATE ,
473476 UPDATE : this . localPlanStage2 . UPDATE ,
474- MOVE : this . localPlanStage2 . MOVE . map ( mappingsSnapshot , ItemLocation . LOCAL ) ,
477+ // skipErroneousActions: see the server stage 3 plan above.
478+ MOVE : this . localPlanStage2 . MOVE . map ( mappingsSnapshot , ItemLocation . LOCAL , ( ) => true , true ) ,
475479 REMOVE : this . localPlanStage2 . REMOVE ,
476480 REORDER : this . localPlanStage2 . REORDER ,
477481 }
@@ -539,13 +543,21 @@ export default class SyncProcess {
539543 mappingsSnapshot
540544 )
541545
546+ // skipErroneousActions: a REORDER targeting a folder that can no longer be mapped is
547+ // moot (the folder was moved/removed); drop it instead of throwing MappingFailureError,
548+ // which would force a cache reset + from-scratch resync that duplicates on non-atomic
549+ // servers.
542550 this . localReorders = localReorders3 . map (
543551 mappingsSnapshot ,
544- ItemLocation . LOCAL
552+ ItemLocation . LOCAL ,
553+ ( ) => true ,
554+ true
545555 )
546556 this . serverReorders = serverReorders3 . map (
547557 mappingsSnapshot ,
548- ItemLocation . SERVER
558+ ItemLocation . SERVER ,
559+ ( ) => true ,
560+ true
549561 )
550562 }
551563
0 commit comments