Skip to content

Commit

Permalink
Add a cachebuster to initial /sync
Browse files Browse the repository at this point in the history
... in the hope of fending off weird firefox restore issues
  • Loading branch information
richvdh committed Apr 13, 2016
1 parent 526e1d5 commit 0282021
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0282021

Please sign in to comment.