You've already forked matrix-js-sdk
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:
10
lib/sync.js
10
lib/sync.js
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user