Skip to content

Commit e551b92

Browse files
authored
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](matrix-org/matrix-rust-sdk#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`
1 parent 32f51e8 commit e551b92

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
],
5050
"dependencies": {
5151
"@babel/runtime": "^7.12.5",
52-
"@matrix-org/matrix-sdk-crypto-wasm": "^15.1.0",
52+
"@matrix-org/matrix-sdk-crypto-wasm": "^15.2.0",
5353
"another-json": "^0.2.0",
5454
"bs58": "^6.0.0",
5555
"content-type": "^1.0.4",

spec/unit/rust-crypto/verification.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ describe("VerificationRequest", () => {
156156
);
157157

158158
const verificationRequestContent = JSON.parse(await bobUserIdentity.verificationRequestContent(methods));
159+
todoFixupVerificationRequestContent(verificationRequestContent);
160+
159161
await bobOlmMachine.receiveVerificationEvent(
160162
JSON.stringify({
161163
type: "m.room.message",
@@ -289,6 +291,8 @@ describe("VerificationRequest", () => {
289291
);
290292

291293
const verificationRequestContent = JSON.parse(await bobUserIdentity.verificationRequestContent(methods));
294+
todoFixupVerificationRequestContent(verificationRequestContent);
295+
292296
await bobOlmMachine.receiveVerificationEvent(
293297
JSON.stringify({
294298
type: "m.room.message",
@@ -405,6 +409,8 @@ describe("VerificationRequest", () => {
405409
);
406410

407411
const verificationRequestContent = JSON.parse(await bobUserIdentity.verificationRequestContent(methods));
412+
todoFixupVerificationRequestContent(verificationRequestContent);
413+
408414
await bobOlmMachine.receiveVerificationEvent(
409415
JSON.stringify({
410416
type: "m.room.message",
@@ -460,6 +466,15 @@ describe("VerificationRequest", () => {
460466
});
461467
});
462468

469+
/**
470+
* Needed until https://github.com/matrix-org/matrix-rust-sdk/issues/5643 is fixed.
471+
*
472+
* Modify the content of the supplied content to include `msgtype: m.key.verification.request`.
473+
*/
474+
function todoFixupVerificationRequestContent(content: any) {
475+
content.msgtype = "m.key.verification.request";
476+
}
477+
463478
describe("isVerificationEvent", () => {
464479
it.each([
465480
[EventType.KeyVerificationCancel],

src/rust-crypto/rust-crypto.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,12 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
10861086
verificationMethodIdentifierToMethod(method),
10871087
);
10881088
// Get the request content to send to the DM room
1089-
const verificationEventContent: string = await userIdentity.verificationRequestContent(methods);
1089+
const verCont: string = await userIdentity.verificationRequestContent(methods);
1090+
1091+
// TODO: due to https://github.com/matrix-org/matrix-rust-sdk/issues/5643, we need to fix up the verification request content to include `msgtype`.
1092+
const verContObj = JSON.parse(verCont);
1093+
verContObj["msgtype"] = "m.key.verification.request";
1094+
const verificationEventContent: string = JSON.stringify(verContObj);
10901095

10911096
// Send the request content to send to the DM room
10921097
const eventId = await this.sendVerificationRequestContent(roomId, verificationEventContent);

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,10 +1742,10 @@
17421742
"@jridgewell/resolve-uri" "^3.1.0"
17431743
"@jridgewell/sourcemap-codec" "^1.4.14"
17441744

1745-
"@matrix-org/matrix-sdk-crypto-wasm@^15.1.0":
1746-
version "15.1.0"
1747-
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-15.1.0.tgz#653956f5f6daced55a9df3d2c1114eb2c017b528"
1748-
integrity sha512-ZsDdjn46J3+VxsDLmaSODuS+qtGZB/i3Cg9tWL1QPNjvAWzNaTHQ7glleByI2PKVBm83aklfuhGKT2MqE1ZsEA==
1745+
"@matrix-org/matrix-sdk-crypto-wasm@^15.2.0":
1746+
version "15.2.0"
1747+
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-15.2.0.tgz#c49bb0ad17c0b14602a4b5730b2ac9d6a3c91923"
1748+
integrity sha512-Yjp7hWztNr/v4j9incvM0ByLzkGPf/bQLz7gn4ZdxOGhpr8919C5yPLXJkk5gC6AIrxpJUWiYYt6AJSFCGn5dQ==
17491749

17501750
"@matrix-org/[email protected]":
17511751
version "3.2.15"

0 commit comments

Comments
 (0)