1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-01 04:43:29 +03:00

Add a cachebuster to initial /sync

... in the hope of fending off weird firefox restore issues
This commit is contained in:
Richard van der Hoff
2016-04-13 22:17:10 +01:00
parent 526e1d59e9
commit 0282021e09

View File

@@ -461,9 +461,17 @@ SyncApi.prototype._sync = function(syncOptions) {
var qps = { var qps = {
filter: filterId, filter: filterId,
timeout: this.opts.pollTimeout, 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) { if (self._syncConnectionLost) {
// we think the connection is dead. If it comes back up, we won't know // 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 // about it till /sync returns. If the timeout= is high, this could