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

Fix race condition in device list query

Fix a race where device list queries completing out-of-order could lead to us
thinking that we were more in-sync than we actually were.
This commit is contained in:
Richard van der Hoff
2017-02-13 16:21:49 +00:00
parent 4d2bc88305
commit 82f5997e61
3 changed files with 203 additions and 67 deletions

View File

@@ -778,7 +778,7 @@ Crypto.prototype._onSyncCompleted = function(syncData) {
// if that failed, we fall back to invalidating everyone.
console.warn("Error fetching changed device list", e);
this._invalidateDeviceListForAllActiveUsers();
return this._deviceList.refreshOutdatedDeviceLists();
this._deviceList.refreshOutdatedDeviceLists();
}).done();
} else {
// otherwise, we have to invalidate all devices for all users we
@@ -790,7 +790,7 @@ Crypto.prototype._onSyncCompleted = function(syncData) {
}
// catch up on any new devices we got told about during the sync.
this._deviceList.refreshOutdatedDeviceLists().done();
this._deviceList.refreshOutdatedDeviceLists();
};
/**
@@ -869,7 +869,7 @@ Crypto.prototype._invalidateDeviceListsSince = function(oldSyncToken) {
this._deviceList.invalidateUserDeviceList(u);
}
});
return this._deviceList.refreshOutdatedDeviceLists();
this._deviceList.refreshOutdatedDeviceLists();
});
};