Skip to content

Commit 6d1d32f

Browse files
committed
fix(SyncProcess): Don't apply skipErroneousActions so broadly
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent 1f0e8c3 commit 6d1d32f

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

src/lib/strategies/Default.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -359,27 +359,21 @@ export default class SyncProcess {
359359
mappingsSnapshot = this.mappings.getSnapshot()
360360
Logger.log('Mapping server plan')
361361

362-
// skipErroneousActions on UPDATE/REMOVE: an UPDATE or REMOVE whose item can no longer
363-
// be mapped to the target references something that doesn't exist there, so it's moot —
364-
// drop it instead of throwing MappingFailureError (which forces a cache reset + from-scratch
365-
// resync that re-applies already-committed actions and duplicates them on non-atomic servers).
366-
// CREATE is deliberately left throwing: dropping an unmappable CREATE would silently lose
367-
// the new item rather than being a no-op.
368362
this.serverPlanStage2 = {
369363
CREATE: this.serverPlanStage1.CREATE.map(mappingsSnapshot, ItemLocation.SERVER),
370-
UPDATE: this.serverPlanStage1.UPDATE.map(mappingsSnapshot, ItemLocation.SERVER, () => true, true),
364+
UPDATE: this.serverPlanStage1.UPDATE.map(mappingsSnapshot, ItemLocation.SERVER),
371365
MOVE: this.serverPlanStage1.MOVE,
372-
REMOVE: this.serverPlanStage1.REMOVE.map(mappingsSnapshot, ItemLocation.SERVER, () => true, true),
366+
REMOVE: this.serverPlanStage1.REMOVE.map(mappingsSnapshot, ItemLocation.SERVER),
373367
REORDER: this.serverPlanStage1.REORDER,
374368
}
375369

376370
Logger.log('Mapping local plan')
377371

378372
this.localPlanStage2 = {
379373
CREATE: this.localPlanStage1.CREATE.map(mappingsSnapshot, ItemLocation.LOCAL),
380-
UPDATE: this.localPlanStage1.UPDATE.map(mappingsSnapshot, ItemLocation.LOCAL, () => true, true),
374+
UPDATE: this.localPlanStage1.UPDATE.map(mappingsSnapshot, ItemLocation.LOCAL),
381375
MOVE: this.localPlanStage1.MOVE,
382-
REMOVE: this.localPlanStage1.REMOVE.map(mappingsSnapshot, ItemLocation.LOCAL, () => true, true),
376+
REMOVE: this.localPlanStage1.REMOVE.map(mappingsSnapshot, ItemLocation.LOCAL),
383377
REORDER: this.localPlanStage1.REORDER,
384378
}
385379
}

0 commit comments

Comments
 (0)