From 8f5219fb79957524d9904e23cd05af0bf18b4c1e Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sun, 2 Jul 2017 21:40:50 +0100 Subject: [PATCH] Fixed note conflict sync --- CliClient/tests/support/jasmine.json | 2 +- lib/synchronizer.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CliClient/tests/support/jasmine.json b/CliClient/tests/support/jasmine.json index 3ea316690..e56eb01b7 100644 --- a/CliClient/tests/support/jasmine.json +++ b/CliClient/tests/support/jasmine.json @@ -6,6 +6,6 @@ "helpers": [ "helpers/**/*.js" ], - "stopSpecOnExpectationFailure": false, + "stopSpecOnExpectationFailure": true, "random": false } diff --git a/lib/synchronizer.js b/lib/synchronizer.js index da05ed6b1..0c5cedc19 100644 --- a/lib/synchronizer.js +++ b/lib/synchronizer.js @@ -174,6 +174,7 @@ class Synchronizer { this.logSyncOperation(action, local, remote, reason); + if (local.type_ == BaseModel.MODEL_TYPE_RESOURCE && (action == 'createRemote' || (action == 'itemConflict' && remote))) { let remoteContentPath = this.resourceDirName_ + '/' + local.id; let resourceContent = await Resource.content(local); @@ -223,6 +224,8 @@ class Synchronizer { local.sync_time = time.unixMs(); await ItemClass.save(local, { autoTimestamp: false }); + } else { + await ItemClass.delete(local.id); } }