1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2026-01-03 23:22:30 +03:00

Avoid a packetstorm of device queries on startup

Two main changes here:
 * when we get an m.new_device event for a device we know about, ignore it
 * Batch up the m.new_device events received during initialsync and spam out
   all the queries at once.
This commit is contained in:
Richard van der Hoff
2016-11-17 15:31:23 +00:00
parent 749f53a22b
commit 036d1da013
4 changed files with 180 additions and 63 deletions

View File

@@ -371,21 +371,6 @@ describe("MatrixClient", function() {
httpBackend.flush();
});
it("should return a rejected promise if the request fails", function(done) {
httpBackend.when("POST", "/keys/query").respond(400);
var exceptionThrown;
client.downloadKeys(["bottom"]).then(function() {
fail("download didn't fail");
}, function(err) {
exceptionThrown = err;
}).then(function() {
expect(exceptionThrown).toBeTruthy();
}).catch(utils.failTest).done(done);
httpBackend.flush();
});
});
describe("deleteDevice", function() {