Skip to content

Commit 9289989

Browse files
authored
Merge branch 'develop' into renovate/fake-indexeddb-6.x
2 parents 000aea0 + f95954c commit 9289989

30 files changed

+2922
-747
lines changed

CHANGELOG.md

+25
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
Changes in [33.0.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v33.0.0) (2024-06-04)
2+
==================================================================================================
3+
## 🚨 BREAKING CHANGES
4+
5+
* Remove more deprecated methods, fields, and exports ([#4217](https://github.com/matrix-org/matrix-js-sdk/pull/4217)). Contributed by @t3chguy.
6+
* Remove deprecated methods and fields ([#4201](https://github.com/matrix-org/matrix-js-sdk/pull/4201)). Contributed by @t3chguy.
7+
8+
## 🦖 Deprecations
9+
10+
* Remove more deprecated methods, fields, and exports ([#4217](https://github.com/matrix-org/matrix-js-sdk/pull/4217)). Contributed by @t3chguy.
11+
* Remove deprecated methods and fields ([#4201](https://github.com/matrix-org/matrix-js-sdk/pull/4201)). Contributed by @t3chguy.
12+
13+
## ✨ Features
14+
15+
* `initRustCrypto`: allow app to pass in the store key directly ([#4210](https://github.com/matrix-org/matrix-js-sdk/pull/4210)). Contributed by @richvdh.
16+
* Preserve ESM for async imports to work correctly ([#4187](https://github.com/matrix-org/matrix-js-sdk/pull/4187)). Contributed by @ms-dosx86.
17+
18+
## 🐛 Bug Fixes
19+
20+
* Don't run migration for Rust crypto if the legacy store is empty ([#4218](https://github.com/matrix-org/matrix-js-sdk/pull/4218)). Contributed by @andybalaam.
21+
* Bump matrix-sdk-crypto-wasm to 5.0.0 ([#4216](https://github.com/matrix-org/matrix-js-sdk/pull/4216)). Contributed by @richvdh.
22+
* Wire up verification cancel \& mismatch for rust crypto ([#4202](https://github.com/matrix-org/matrix-js-sdk/pull/4202)). Contributed by @t3chguy.
23+
* Only pass id\_server if we had one to begin with ([#4200](https://github.com/matrix-org/matrix-js-sdk/pull/4200)). Contributed by @t3chguy.
24+
25+
126
Changes in [32.4.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v32.4.0) (2024-05-22)
227
==================================================================================================
328
* No changes

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "matrix-js-sdk",
3-
"version": "32.4.0",
3+
"version": "33.0.0",
44
"description": "Matrix Client-Server SDK for Javascript",
55
"engines": {
66
"node": ">=18.0.0"
@@ -105,7 +105,7 @@
105105
"eslint-plugin-jest": "^28.0.0",
106106
"eslint-plugin-jsdoc": "^48.0.0",
107107
"eslint-plugin-matrix-org": "^1.0.0",
108-
"eslint-plugin-tsdoc": "^0.2.17",
108+
"eslint-plugin-tsdoc": "^0.3.0",
109109
"eslint-plugin-unicorn": "^53.0.0",
110110
"fake-indexeddb": "^6.0.0",
111111
"fetch-mock": "9.11.0",
@@ -119,7 +119,7 @@
119119
"lint-staged": "^15.0.2",
120120
"matrix-mock-request": "^2.5.0",
121121
"node-fetch": "^2.7.0",
122-
"prettier": "3.2.5",
122+
"prettier": "3.3.0",
123123
"rimraf": "^5.0.0",
124124
"ts-node": "^10.9.2",
125125
"typedoc": "^0.25.10",

spec/integ/crypto/crypto.spec.ts

+68
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,27 @@ describe.each(Object.entries(CRYPTO_BACKENDS))("crypto (%s)", (backend: string,
630630
expect(ev.decryptionFailureReason).toEqual(DecryptionFailureCode.HISTORICAL_MESSAGE_USER_NOT_JOINED);
631631
});
632632

633+
newBackendOnly(
634+
"fails with NOT_JOINED if user is not member of room (MSC4115 unstable prefix)",
635+
async () => {
636+
fetchMock.get("path:/_matrix/client/v3/room_keys/version", {
637+
status: 404,
638+
body: { errcode: "M_NOT_FOUND", error: "No current backup version." },
639+
});
640+
expectAliceKeyQuery({ device_keys: { "@alice:localhost": {} }, failures: {} });
641+
await startClientAndAwaitFirstSync();
642+
643+
const ev = await sendEventAndAwaitDecryption({
644+
unsigned: {
645+
[UNSIGNED_MEMBERSHIP_FIELD.altName!]: "leave",
646+
},
647+
});
648+
expect(ev.decryptionFailureReason).toEqual(
649+
DecryptionFailureCode.HISTORICAL_MESSAGE_USER_NOT_JOINED,
650+
);
651+
},
652+
);
653+
633654
newBackendOnly(
634655
"fails with another error when the server reports user was a member of the room",
635656
async () => {
@@ -654,6 +675,30 @@ describe.each(Object.entries(CRYPTO_BACKENDS))("crypto (%s)", (backend: string,
654675
},
655676
);
656677

678+
newBackendOnly(
679+
"fails with another error when the server reports user was a member of the room (MSC4115 unstable prefix)",
680+
async () => {
681+
// This tests that when the server reports that the user
682+
// was invited at the time the event was sent, then we
683+
// don't get a HISTORICAL_MESSAGE_USER_NOT_JOINED error,
684+
// and instead get some other error, since the user should
685+
// have gotten the key for the event.
686+
fetchMock.get("path:/_matrix/client/v3/room_keys/version", {
687+
status: 404,
688+
body: { errcode: "M_NOT_FOUND", error: "No current backup version." },
689+
});
690+
expectAliceKeyQuery({ device_keys: { "@alice:localhost": {} }, failures: {} });
691+
await startClientAndAwaitFirstSync();
692+
693+
const ev = await sendEventAndAwaitDecryption({
694+
unsigned: {
695+
[UNSIGNED_MEMBERSHIP_FIELD.altName!]: "invite",
696+
},
697+
});
698+
expect(ev.decryptionFailureReason).toEqual(DecryptionFailureCode.HISTORICAL_MESSAGE_NO_KEY_BACKUP);
699+
},
700+
);
701+
657702
newBackendOnly(
658703
"fails with another error when the server reports user was a member of the room",
659704
async () => {
@@ -676,6 +721,29 @@ describe.each(Object.entries(CRYPTO_BACKENDS))("crypto (%s)", (backend: string,
676721
expect(ev.decryptionFailureReason).toEqual(DecryptionFailureCode.HISTORICAL_MESSAGE_NO_KEY_BACKUP);
677722
},
678723
);
724+
725+
newBackendOnly(
726+
"fails with another error when the server reports user was a member of the room (MSC4115 unstable prefix)",
727+
async () => {
728+
// This tests that when the server reports the user's
729+
// membership, and reports that the user was joined, then we
730+
// don't get a HISTORICAL_MESSAGE_USER_NOT_JOINED error, and
731+
// instead get some other error.
732+
fetchMock.get("path:/_matrix/client/v3/room_keys/version", {
733+
status: 404,
734+
body: { errcode: "M_NOT_FOUND", error: "No current backup version." },
735+
});
736+
expectAliceKeyQuery({ device_keys: { "@alice:localhost": {} }, failures: {} });
737+
await startClientAndAwaitFirstSync();
738+
739+
const ev = await sendEventAndAwaitDecryption({
740+
unsigned: {
741+
[UNSIGNED_MEMBERSHIP_FIELD.altName!]: "join",
742+
},
743+
});
744+
expect(ev.decryptionFailureReason).toEqual(DecryptionFailureCode.HISTORICAL_MESSAGE_NO_KEY_BACKUP);
745+
},
746+
);
679747
});
680748

681749
it("Decryption fails with Unable to decrypt for other errors", async () => {

0 commit comments

Comments
 (0)