From ecef9fd75519bd9adb8fda9afd8e19f03588576a Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Thu, 20 Jul 2023 11:46:55 +0200 Subject: [PATCH] Fix `CryptoApi#getVerificationRequestsToDeviceInProgress` (#3611) --- spec/integ/crypto/verification.spec.ts | 8 ++++++++ src/rust-crypto/rust-crypto.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/spec/integ/crypto/verification.spec.ts b/spec/integ/crypto/verification.spec.ts index a245b56e2..e13b80c54 100644 --- a/spec/integ/crypto/verification.spec.ts +++ b/spec/integ/crypto/verification.spec.ts @@ -164,6 +164,14 @@ describe.each(Object.entries(CRYPTO_BACKENDS))("verification (%s)", (backend: st expect(requests[0].transactionId).toEqual(transactionId); } + // check that the returned request depends on the given userID + { + const requests = aliceClient + .getCrypto()! + .getVerificationRequestsToDeviceInProgress("@unknown:localhost"); + expect(requests.length).toEqual(0); + } + let toDeviceMessage = requestBody.messages[TEST_USER_ID][TEST_DEVICE_ID]; expect(toDeviceMessage.from_device).toEqual(aliceClient.deviceId); expect(toDeviceMessage.transaction_id).toEqual(transactionId); diff --git a/src/rust-crypto/rust-crypto.ts b/src/rust-crypto/rust-crypto.ts index 6da6dd53c..7e267071b 100644 --- a/src/rust-crypto/rust-crypto.ts +++ b/src/rust-crypto/rust-crypto.ts @@ -575,7 +575,7 @@ export class RustCrypto extends TypedEventEmitter request.roomId === undefined)