@@ -34,7 +34,7 @@ export default class UnidirectionalSyncProcess extends DefaultStrategy {
3434 getMembersToPersist ( ) {
3535 const members = [ ]
3636 // Stage 0
37- if ( ! this . revertPlan ) {
37+ if ( ! this . revertPlan && this . actionsPlanned === 0 ) {
3838 members . push ( 'localScanResult' )
3939 members . push ( 'serverScanResult' )
4040 }
@@ -308,7 +308,7 @@ export default class UnidirectionalSyncProcess extends DefaultStrategy {
308308
309309 await Parallel . each (
310310 sourceScanResult . CREATE . getActions ( ) ,
311- async ( action ) => {
311+ async ( action ) => {
312312 // recreate it on slave resource otherwise
313313 const payload = await this . translateCompleteItem (
314314 action . payload ,
@@ -331,15 +331,15 @@ export default class UnidirectionalSyncProcess extends DefaultStrategy {
331331
332332 await Parallel . each (
333333 targetScanResult . CREATE . getActions ( ) ,
334- async ( action ) => {
334+ async ( action ) => {
335335 slavePlan . REMOVE . commit ( { ...action , type : ActionType . REMOVE } )
336336 } ,
337337 ACTION_CONCURRENCY
338338 )
339339
340340 await Parallel . each (
341341 targetScanResult . UPDATE . getActions ( ) ,
342- async ( action ) => {
342+ async ( action ) => {
343343 const payload = action . oldItem . cloneWithLocation (
344344 false ,
345345 action . payload . location
@@ -360,7 +360,7 @@ export default class UnidirectionalSyncProcess extends DefaultStrategy {
360360
361361 await Parallel . each (
362362 targetScanResult . MOVE . getActions ( ) ,
363- async ( action ) => {
363+ async ( action ) => {
364364 const payload = action . payload . cloneWithLocation (
365365 false ,
366366 action . oldItem . location
@@ -389,7 +389,7 @@ export default class UnidirectionalSyncProcess extends DefaultStrategy {
389389 )
390390 if ( newItem instanceof Folder ) {
391391 const nonexistingItems = [ ]
392- await newItem . traverse ( async ( child , parentFolder ) => {
392+ await newItem . traverse ( async ( child , parentFolder ) => {
393393 child . id = Mappings . mapId ( mappingsSnapshot , child , fakeLocation )
394394 if ( typeof child . id === 'undefined' ) {
395395 nonexistingItems . push ( child )
0 commit comments