diff --git a/lib/sync.js b/lib/sync.js index 95d07e281..6b4a78d92 100644 --- a/lib/sync.js +++ b/lib/sync.js @@ -428,7 +428,7 @@ SyncApi.prototype._sync = function(syncOptions, attempt) { // - The isBrandNewRoom boilerplate is boilerplatey. try { - self._processSyncResponse(data); + self._processSyncResponse(syncToken, data); } catch (e) { console.error("Caught /sync error:"); @@ -481,9 +481,11 @@ SyncApi.prototype._sync = function(syncOptions, attempt) { * Process data returned from a sync response and propagate it * into the model objects * + * @param {string} syncToken the old next_batch token sent to this + * sync request. * @param {Object} data The response from /sync */ -SyncApi.prototype._processSyncResponse = function(data) { +SyncApi.prototype._processSyncResponse = function(syncToken, data) { var client = this.client; var self = this;