You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-23 17:02:25 +03:00
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`
This commit is contained in:
@@ -49,7 +49,7 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.12.5",
|
"@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",
|
"another-json": "^0.2.0",
|
||||||
"bs58": "^6.0.0",
|
"bs58": "^6.0.0",
|
||||||
"content-type": "^1.0.4",
|
"content-type": "^1.0.4",
|
||||||
|
|||||||
@@ -156,6 +156,8 @@ describe("VerificationRequest", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const verificationRequestContent = JSON.parse(await bobUserIdentity.verificationRequestContent(methods));
|
const verificationRequestContent = JSON.parse(await bobUserIdentity.verificationRequestContent(methods));
|
||||||
|
todoFixupVerificationRequestContent(verificationRequestContent);
|
||||||
|
|
||||||
await bobOlmMachine.receiveVerificationEvent(
|
await bobOlmMachine.receiveVerificationEvent(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
type: "m.room.message",
|
type: "m.room.message",
|
||||||
@@ -289,6 +291,8 @@ describe("VerificationRequest", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const verificationRequestContent = JSON.parse(await bobUserIdentity.verificationRequestContent(methods));
|
const verificationRequestContent = JSON.parse(await bobUserIdentity.verificationRequestContent(methods));
|
||||||
|
todoFixupVerificationRequestContent(verificationRequestContent);
|
||||||
|
|
||||||
await bobOlmMachine.receiveVerificationEvent(
|
await bobOlmMachine.receiveVerificationEvent(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
type: "m.room.message",
|
type: "m.room.message",
|
||||||
@@ -405,6 +409,8 @@ describe("VerificationRequest", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const verificationRequestContent = JSON.parse(await bobUserIdentity.verificationRequestContent(methods));
|
const verificationRequestContent = JSON.parse(await bobUserIdentity.verificationRequestContent(methods));
|
||||||
|
todoFixupVerificationRequestContent(verificationRequestContent);
|
||||||
|
|
||||||
await bobOlmMachine.receiveVerificationEvent(
|
await bobOlmMachine.receiveVerificationEvent(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
type: "m.room.message",
|
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", () => {
|
describe("isVerificationEvent", () => {
|
||||||
it.each([
|
it.each([
|
||||||
[EventType.KeyVerificationCancel],
|
[EventType.KeyVerificationCancel],
|
||||||
|
|||||||
@@ -1086,7 +1086,12 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
|
|||||||
verificationMethodIdentifierToMethod(method),
|
verificationMethodIdentifierToMethod(method),
|
||||||
);
|
);
|
||||||
// Get the request content to send to the DM room
|
// Get the request content to send to the DM room
|
||||||
const verificationEventContent: string = await userIdentity.verificationRequestContent(methods);
|
const verCont: string = await userIdentity.verificationRequestContent(methods);
|
||||||
|
|
||||||
|
// 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`.
|
||||||
|
const verContObj = JSON.parse(verCont);
|
||||||
|
verContObj["msgtype"] = "m.key.verification.request";
|
||||||
|
const verificationEventContent: string = JSON.stringify(verContObj);
|
||||||
|
|
||||||
// Send the request content to send to the DM room
|
// Send the request content to send to the DM room
|
||||||
const eventId = await this.sendVerificationRequestContent(roomId, verificationEventContent);
|
const eventId = await this.sendVerificationRequestContent(roomId, verificationEventContent);
|
||||||
|
|||||||
@@ -1742,10 +1742,10 @@
|
|||||||
"@jridgewell/resolve-uri" "^3.1.0"
|
"@jridgewell/resolve-uri" "^3.1.0"
|
||||||
"@jridgewell/sourcemap-codec" "^1.4.14"
|
"@jridgewell/sourcemap-codec" "^1.4.14"
|
||||||
|
|
||||||
"@matrix-org/matrix-sdk-crypto-wasm@^15.1.0":
|
"@matrix-org/matrix-sdk-crypto-wasm@^15.2.0":
|
||||||
version "15.1.0"
|
version "15.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-15.1.0.tgz#653956f5f6daced55a9df3d2c1114eb2c017b528"
|
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-15.2.0.tgz#c49bb0ad17c0b14602a4b5730b2ac9d6a3c91923"
|
||||||
integrity sha512-ZsDdjn46J3+VxsDLmaSODuS+qtGZB/i3Cg9tWL1QPNjvAWzNaTHQ7glleByI2PKVBm83aklfuhGKT2MqE1ZsEA==
|
integrity sha512-Yjp7hWztNr/v4j9incvM0ByLzkGPf/bQLz7gn4ZdxOGhpr8919C5yPLXJkk5gC6AIrxpJUWiYYt6AJSFCGn5dQ==
|
||||||
|
|
||||||
"@matrix-org/olm@3.2.15":
|
"@matrix-org/olm@3.2.15":
|
||||||
version "3.2.15"
|
version "3.2.15"
|
||||||
|
|||||||
Reference in New Issue
Block a user