Skip to content

Commit

Permalink
Allowing reSync on sync up
Browse files Browse the repository at this point in the history
  • Loading branch information
wmathurin committed Nov 11, 2017
1 parent 7129258 commit 99b3b47
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions test/MockSmartSyncPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,13 @@ var MockSmartSyncPlugin = (function(window) {

reSync: function(syncIdOrName, successCB, errorCB) {
var syncId = typeof syncIdOrName === "string" ? this.getSyncIdFromName(syncIdOrName) : syncIdOrName;
this.actualSyncDown(syncId, successCB, errorCB);
var sync = this.syncs[syncId];
if (sync.type == "syncDown") {
this.actualSyncDown(syncId, successCB, errorCB);
}
else {
this.actualSyncUp(syncId, successCB, errorCB);
}
},

cleanResyncGhosts: function(syncId, successCB, errorCB) {
Expand Down Expand Up @@ -199,8 +205,16 @@ var MockSmartSyncPlugin = (function(window) {
},

syncUp: function(target, soupName, options, syncName, successCB, errorCB) {
var syncId = this.recordSync("syncUp", target, soupName, options, syncName);
this.actualSyncUp(syncId, successCB, errorCB);
},

actualSyncUp: function(syncId, successCB, errorCB) {
var self = this;
var syncId = self.recordSync("syncUp", target, soupName, options, syncName);
var sync = self.syncs[syncId];
var target = sync.target;
var soupName = sync.soupName;
var options = sync.options;
var cache = new Force.StoreCache(soupName, null, null, self.storeConfig.isGlobalStore,self.storeConfig.storeName);
var collection = new Force.SObjectCollection();
var numberRecords;
Expand Down

0 comments on commit 99b3b47

Please sign in to comment.