From e551b92a07da011fb09bcec32e4855a2c46e8345 Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Thu, 11 Sep 2025 15:53:13 +0100 Subject: [PATCH] Update matrix-sdk-crypto-wasm to 15.2.0 (#4991) * Update matrix-sdk-crypto-wasm to 15.2.0 Most relevant changes: - History sharing: improve efficiency of building key bundle ([matrix-rust-sdk#5513](https://github.com/matrix-org/matrix-rust-sdk/issues/5513)) * Work around matrix-rust-sdk#5643 Modify the message content coming from Rust API to include the missing property `msgtype: m.key.verification.request` --- package.json | 2 +- spec/unit/rust-crypto/verification.spec.ts | 15 +++++++++++++++ src/rust-crypto/rust-crypto.ts | 7 ++++++- yarn.lock | 8 ++++---- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 8d069e0f3..e5075cfb2 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ ], "dependencies": { "@babel/runtime": "^7.12.5", - "@matrix-org/matrix-sdk-crypto-wasm": "^15.1.0", + "@matrix-org/matrix-sdk-crypto-wasm": "^15.2.0", "another-json": "^0.2.0", "bs58": "^6.0.0", "content-type": "^1.0.4", diff --git a/spec/unit/rust-crypto/verification.spec.ts b/spec/unit/rust-crypto/verification.spec.ts index 1c67897e5..11da5c19c 100644 --- a/spec/unit/rust-crypto/verification.spec.ts +++ b/spec/unit/rust-crypto/verification.spec.ts @@ -156,6 +156,8 @@ describe("VerificationRequest", () => { ); const verificationRequestContent = JSON.parse(await bobUserIdentity.verificationRequestContent(methods)); + todoFixupVerificationRequestContent(verificationRequestContent); + await bobOlmMachine.receiveVerificationEvent( JSON.stringify({ type: "m.room.message", @@ -289,6 +291,8 @@ describe("VerificationRequest", () => { ); const verificationRequestContent = JSON.parse(await bobUserIdentity.verificationRequestContent(methods)); + todoFixupVerificationRequestContent(verificationRequestContent); + await bobOlmMachine.receiveVerificationEvent( JSON.stringify({ type: "m.room.message", @@ -405,6 +409,8 @@ describe("VerificationRequest", () => { ); const verificationRequestContent = JSON.parse(await bobUserIdentity.verificationRequestContent(methods)); + todoFixupVerificationRequestContent(verificationRequestContent); + await bobOlmMachine.receiveVerificationEvent( JSON.stringify({ type: "m.room.message", @@ -460,6 +466,15 @@ describe("VerificationRequest", () => { }); }); +/** + * Needed until https://github.com/matrix-org/matrix-rust-sdk/issues/5643 is fixed. + * + * Modify the content of the supplied content to include `msgtype: m.key.verification.request`. + */ +function todoFixupVerificationRequestContent(content: any) { + content.msgtype = "m.key.verification.request"; +} + describe("isVerificationEvent", () => { it.each([ [EventType.KeyVerificationCancel], diff --git a/src/rust-crypto/rust-crypto.ts b/src/rust-crypto/rust-crypto.ts index f23bbf718..eb22b5bc5 100644 --- a/src/rust-crypto/rust-crypto.ts +++ b/src/rust-crypto/rust-crypto.ts @@ -1086,7 +1086,12 @@ export class RustCrypto extends TypedEventEmitter