diff --git a/lib/sync.js b/lib/sync.js index e7ae2ab0a..f639b3f64 100644 --- a/lib/sync.js +++ b/lib/sync.js @@ -461,9 +461,17 @@ SyncApi.prototype._sync = function(syncOptions) { var qps = { filter: filterId, timeout: this.opts.pollTimeout, - since: syncToken || undefined // do not send 'null' }; + if (syncToken) { + qps.since = syncToken; + } else { + // use a cachebuster for initialsyncs, to make sure that + // we don't get a stale sync + // (https://github.com/vector-im/vector-web/issues/1354) + qps._cacheBuster = Date.now(); + } + if (self._syncConnectionLost) { // we think the connection is dead. If it comes back up, we won't know // about it till /sync returns. If the timeout= is high, this could