You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-29 16:43:09 +03:00
Fix early return in MatrixClient.setGuestAccess
(as well as a similar bug in the test suite) Turns out that `q.all(a, b)` === `q.all([a])`, rather than `q.all([a,b])`: it only waits for the *first* promise - which means that `client.setGuestAccess` would swallow any errors returned from the API.
This commit is contained in:
@@ -426,8 +426,10 @@ describe("MatrixClient crypto", function() {
|
||||
expect(bobDeviceKeys.keys["curve25519:" + bobDeviceId]).toBeTruthy();
|
||||
bobDeviceKeys.keys["curve25519:" + bobDeviceId] += "abc";
|
||||
|
||||
return q.all(aliTestClient.client.downloadKeys([bobUserId]),
|
||||
expectAliQueryKeys());
|
||||
return q.all([
|
||||
aliTestClient.client.downloadKeys([bobUserId]),
|
||||
expectAliQueryKeys(),
|
||||
]);
|
||||
})
|
||||
.then(function() {
|
||||
// should get an empty list
|
||||
|
||||
@@ -2153,7 +2153,7 @@ MatrixClient.prototype.setGuestAccess = function(roomId, opts) {
|
||||
});
|
||||
}
|
||||
|
||||
return q.all(readPromise, writePromise);
|
||||
return q.all([readPromise, writePromise]);
|
||||
};
|
||||
|
||||
// Registration/Login operations
|
||||
|
||||
Reference in New Issue
Block a user