Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 5e94794

Browse files
authored
Merge branch 'develop' into trayicons
2 parents ba6e88c + 4e5cf1b commit 5e94794

File tree

433 files changed

+6566
-6488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

433 files changed

+6566
-6488
lines changed

.eslintrc.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ module.exports = {
4646

4747
"import/no-duplicates": ["error"],
4848
// Ban matrix-js-sdk/src imports in favour of matrix-js-sdk/src/matrix imports to prevent unleashing hell.
49+
// Ban compound-design-tokens raw svg imports in favour of their React component counterparts
4950
"no-restricted-imports": [
5051
"error",
5152
{
@@ -92,6 +93,8 @@ module.exports = {
9293
"!matrix-js-sdk/src/crypto-api",
9394
"!matrix-js-sdk/src/types",
9495
"!matrix-js-sdk/src/testing",
96+
"!matrix-js-sdk/src/utils/**",
97+
"matrix-js-sdk/src/utils/internal/**",
9598
"matrix-js-sdk/lib",
9699
"matrix-js-sdk/lib/",
97100
"matrix-js-sdk/lib/**",
@@ -119,11 +122,8 @@ module.exports = {
119122
"!matrix-js-sdk/src/extensible_events_v1/PollEndEvent",
120123
"!matrix-js-sdk/src/extensible_events_v1/InvalidEventError",
121124
"!matrix-js-sdk/src/crypto",
122-
"!matrix-js-sdk/src/crypto/aes",
123125
"!matrix-js-sdk/src/crypto/keybackup",
124126
"!matrix-js-sdk/src/crypto/deviceinfo",
125-
"!matrix-js-sdk/src/crypto/key_passphrase",
126-
"!matrix-js-sdk/src/crypto/recoverykey",
127127
"!matrix-js-sdk/src/crypto/dehydration",
128128
"!matrix-js-sdk/src/oidc",
129129
"!matrix-js-sdk/src/oidc/discovery",
@@ -151,6 +151,10 @@ module.exports = {
151151
message:
152152
"This regex doesn't actually test for emoji. See the docs at https://emojibase.dev/docs/regex/ and prefer our own EMOJI_REGEX from HtmlUtils.",
153153
},
154+
{
155+
group: ["@vector-im/compound-design-tokens/icons/*"],
156+
message: "Please use @vector-im/compound-design-tokens/assets/web/icons/* instead",
157+
},
154158
],
155159
},
156160
],

.github/labels.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
- name: "A-Timesheet-1"
22
description: "Log any time spent on this into the A-Timesheet-1 project"
3-
color: "#5319E7"
3+
color: "5319E7"
44
- name: "backport staging"
55
description: "Label to automatically backport PR to staging branch"
6-
color: "#B60205"
6+
color: "B60205"
77
- name: "Dependencies"
88
description: "Pull requests that update a dependency file"
9-
color: "#0366d6"
9+
color: "0366d6"
1010
- name: "Sponsored"
11-
color: "#b506d8"
11+
color: "b506d8"
1212
- name: "T-Deprecation"
1313
description: "A pull request that makes something deprecated"
14-
color: "#98e6ae"
14+
color: "98e6ae"
1515
- name: "X-Blocked"
1616
description: "The PR cannot move forward in any capacity until an action is made"
1717
color: "ff7979"
1818
- name: "X-Breaking-Change"
19-
color: "#ff7979"
19+
color: "ff7979"
2020
- name: "X-Upcoming-Release-Blocker"
2121
description: "This does not affect the current release cycle but will affect the next one"
22-
color: "#e99695"
22+
color: "e99695"
2323
- name: "Z-Community-PR"
2424
description: "Issue is solved by a community member's PR"
25-
color: "#ededed"
25+
color: "ededed"
2626
- name: "Z-Experiment"
2727
description: "Experimental PR, primarily up for its Netlify build, high likelihood of never making it beyond here."
28-
color: "#b60205"
28+
color: "b60205"

.github/workflows/notify-element-web.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
name: "Notify Element Web"
1010
runs-on: ubuntu-latest
1111
# Only respect triggers from our develop branch, ignore that of forks
12-
if: github.repository == 'matrix-org/matrix-react-sdk'
12+
if: github.repository == 'element-hq/matrix-react-sdk'
1313
steps:
1414
- name: Notify element-web repo that a new SDK build is on develop
1515
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3

.github/workflows/playwright-image-updates.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
- name: Create Pull Request
2222
id: cpr
23-
uses: peter-evans/create-pull-request@4320041ed380b20e97d388d56a7fb4f9b8c20e79 # v7
23+
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7
2424
with:
2525
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
2626
branch: actions/playwright-image-updates

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ concurrency: ${{ github.workflow }}
1919
jobs:
2020
release:
2121
uses: matrix-org/matrix-js-sdk/.github/workflows/release-make.yml@develop
22-
secrets: inherit
22+
secrets:
23+
ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
24+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2325
with:
2426
final: ${{ inputs.mode == 'final' }}
2527
npm: ${{ inputs.npm }}

.github/workflows/tests.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Checkout code
4040
uses: actions/checkout@v4
4141
with:
42-
repository: ${{ inputs.matrix-js-sdk-sha && 'matrix-org/matrix-react-sdk' || github.repository }}
42+
repository: ${{ inputs.matrix-js-sdk-sha && 'element-hq/matrix-react-sdk' || github.repository }}
4343

4444
- name: Yarn cache
4545
uses: actions/setup-node@v4
@@ -89,14 +89,18 @@ jobs:
8989
coverage
9090
!coverage/lcov-report
9191
92-
skip_sonar:
93-
name: Skip SonarCloud in merge queue
94-
if: github.event_name == 'merge_group' || inputs.disable_coverage == 'true'
95-
runs-on: ubuntu-latest
92+
complete:
93+
name: jest-tests
9694
needs: jest
95+
if: always()
96+
runs-on: ubuntu-latest
9797
steps:
98-
- name: Skip SonarCloud
99-
uses: Sibz/github-status-action@071b5370da85afbb16637d6eed8524a06bc2053e # v1
98+
- if: needs.jest.result != 'skipped' && needs.jest.result != 'success'
99+
run: exit 1
100+
101+
- name: Skip SonarCloud in merge queue
102+
if: github.event_name == 'merge_group' || inputs.disable_coverage == 'true'
103+
uses: Sibz/github-status-action@faaa4d96fecf273bd762985e0e7f9f933c774918 # v1
100104
with:
101105
authToken: ${{ secrets.GITHUB_TOKEN }}
102106
state: success
@@ -111,7 +115,7 @@ jobs:
111115
steps:
112116
- uses: actions/checkout@v4
113117
with:
114-
repository: ${{ inputs.matrix-js-sdk-sha && 'matrix-org/matrix-react-sdk' || github.repository }}
118+
repository: ${{ inputs.matrix-js-sdk-sha && 'element-hq/matrix-react-sdk' || github.repository }}
115119

116120
- uses: actions/setup-node@v4
117121
with:

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
},
6363
"resolutions": {
6464
"@types/react-dom": "17.0.25",
65-
"@types/react": "17.0.80",
65+
"@types/react": "17.0.82",
6666
"@types/seedrandom": "3.0.8",
6767
"oidc-client-ts": "3.0.1",
6868
"jwt-decode": "4.0.0",
@@ -72,9 +72,9 @@
7272
},
7373
"dependencies": {
7474
"@babel/runtime": "^7.12.5",
75-
"@matrix-org/analytics-events": "^0.25.0",
75+
"@matrix-org/analytics-events": "^0.26.0",
7676
"@matrix-org/emojibase-bindings": "^1.1.2",
77-
"@matrix-org/matrix-wysiwyg": "2.37.9",
77+
"@vector-im/matrix-wysiwyg": "2.37.13",
7878
"@matrix-org/react-sdk-module-api": "^2.4.0",
7979
"@matrix-org/spec": "^1.7.0",
8080
"@sentry/browser": "^8.0.0",
@@ -91,7 +91,7 @@
9191
"classnames": "^2.2.6",
9292
"commonmark": "^0.31.0",
9393
"counterpart": "^0.18.6",
94-
"css-tree": "^2.3.1",
94+
"css-tree": "^3.0.0",
9595
"diff-dom": "^5.0.0",
9696
"diff-match-patch": "^1.0.5",
9797
"emojibase-regex": "15.3.2",
@@ -171,7 +171,7 @@
171171
"@types/css-tree": "^2.3.8",
172172
"@types/diff-match-patch": "^1.0.32",
173173
"@types/escape-html": "^1.0.1",
174-
"@types/express": "^4.17.21",
174+
"@types/express": "^5.0.0",
175175
"@types/file-saver": "^2.0.3",
176176
"@types/fs-extra": "^11.0.0",
177177
"@types/glob-to-regexp": "^0.4.1",
@@ -183,7 +183,7 @@
183183
"@types/node-fetch": "^2.6.2",
184184
"@types/pako": "^2.0.0",
185185
"@types/qrcode": "^1.3.5",
186-
"@types/react": "17.0.80",
186+
"@types/react": "17.0.82",
187187
"@types/react-beautiful-dnd": "^13.0.0",
188188
"@types/react-dom": "17.0.25",
189189
"@types/react-transition-group": "^4.4.0",
@@ -198,7 +198,8 @@
198198
"axe-core": "4.10.0",
199199
"babel-jest": "^29.0.0",
200200
"blob-polyfill": "^9.0.0",
201-
"eslint": "8.57.0",
201+
"core-js": "^3.38.1",
202+
"eslint": "8.57.1",
202203
"eslint-config-google": "^0.14.0",
203204
"eslint-config-prettier": "^9.0.0",
204205
"eslint-plugin-deprecate": "0.8.5",
@@ -235,7 +236,7 @@
235236
"stylelint-config-standard": "^36.0.0",
236237
"stylelint-scss": "^6.0.0",
237238
"ts-node": "^10.9.1",
238-
"typescript": "5.5.4",
239+
"typescript": "5.6.2",
239240
"web-streams-polyfill": "^4.0.0"
240241
},
241242
"peerDependencies": {

playwright/e2e/crypto/crypto.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ test.describe("Cryptography", function () {
220220

221221
// Assert that verified icon is rendered
222222
await page.getByTestId("base-card-back-button").click();
223-
await page.locator(".mx_RightPanelTabs").getByText("Info").click();
223+
await page.getByLabel("Room info").nth(1).click();
224224
await expect(page.locator('.mx_RoomSummaryCard_badges [data-kind="success"]')).toContainText("Encrypted");
225225

226226
// Take a snapshot of RoomSummaryCard with a verified E2EE icon

playwright/e2e/crypto/dehydration.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ test.describe("Dehydration", () => {
9494

9595
await viewRoomSummaryByName(page, app, ROOM_NAME);
9696

97-
await page.locator(".mx_RightPanelTabs").getByText("People").click();
97+
await page.locator(".mx_RightPanel").getByRole("menuitem", { name: "People" }).click();
9898
await expect(page.locator(".mx_MemberList")).toBeVisible();
9999

100100
await getMemberTileByName(page, NAME).click();

playwright/e2e/crypto/event-shields.spec.ts

Lines changed: 62 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@ Please see LICENSE files in the repository root for full details.
77
*/
88

99
import { expect, test } from "../../element-web-test";
10-
import { autoJoin, createSharedRoomWithUser, enableKeyBackup, logIntoElement, logOutOfElement, verify } from "./utils";
11-
import { Bot } from "../../pages/bot";
10+
import {
11+
autoJoin,
12+
createSecondBotDevice,
13+
createSharedRoomWithUser,
14+
enableKeyBackup,
15+
logIntoElement,
16+
logOutOfElement,
17+
verify,
18+
} from "./utils";
1219

1320
test.describe("Cryptography", function () {
1421
test.use({
@@ -41,16 +48,14 @@ test.describe("Cryptography", function () {
4148
});
4249
});
4350

44-
test("should show the correct shield on e2e events", async ({ page, app, bot: bob, homeserver }) => {
51+
test("should show the correct shield on e2e events", async ({
52+
page,
53+
app,
54+
bot: bob,
55+
homeserver,
56+
}, workerInfo) => {
4557
// Bob has a second, not cross-signed, device
46-
const bobSecondDevice = new Bot(page, homeserver, {
47-
bootstrapSecretStorage: false,
48-
bootstrapCrossSigning: false,
49-
});
50-
bobSecondDevice.setCredentials(
51-
await homeserver.loginUser(bob.credentials.userId, bob.credentials.password),
52-
);
53-
await bobSecondDevice.prepareClient();
58+
const bobSecondDevice = await createSecondBotDevice(page, homeserver, bob);
5459

5560
await bob.sendEvent(testRoomId, null, "m.room.encrypted", {
5661
algorithm: "m.megolm.v1.aes-sha2",
@@ -117,7 +122,10 @@ test.describe("Cryptography", function () {
117122
await lastTileE2eIcon.focus();
118123
await expect(page.getByRole("tooltip")).toContainText("Encrypted by a device not verified by its owner.");
119124

120-
/* Should show a grey padlock for a message from an unknown device */
125+
/* In legacy crypto: should show a grey padlock for a message from a deleted device.
126+
* In rust crypto: should show a red padlock for a message from an unverified device.
127+
* Rust crypto remembers the verification state of the sending device, so it will know that the device was
128+
* unverified, even if it gets deleted. */
121129
// bob deletes his second device
122130
await bobSecondDevice.evaluate((cli) => cli.logout(true));
123131

@@ -148,7 +156,11 @@ test.describe("Cryptography", function () {
148156
await expect(last).toContainText("test encrypted from unverified");
149157
await expect(lastE2eIcon).toHaveClass(/mx_EventTile_e2eIcon_warning/);
150158
await lastE2eIcon.focus();
151-
await expect(page.getByRole("tooltip")).toContainText("Encrypted by an unknown or deleted device.");
159+
await expect(page.getByRole("tooltip")).toContainText(
160+
workerInfo.project.name === "Legacy Crypto"
161+
? "Encrypted by an unknown or deleted device."
162+
: "Encrypted by a device not verified by its owner.",
163+
);
152164
});
153165

154166
test("Should show a grey padlock for a key restored from backup", async ({
@@ -204,14 +216,7 @@ test.describe("Cryptography", function () {
204216

205217
test("should show the correct shield on edited e2e events", async ({ page, app, bot: bob, homeserver }) => {
206218
// bob has a second, not cross-signed, device
207-
const bobSecondDevice = new Bot(page, homeserver, {
208-
bootstrapSecretStorage: false,
209-
bootstrapCrossSigning: false,
210-
});
211-
bobSecondDevice.setCredentials(
212-
await homeserver.loginUser(bob.credentials.userId, bob.credentials.password),
213-
);
214-
await bobSecondDevice.prepareClient();
219+
const bobSecondDevice = await createSecondBotDevice(page, homeserver, bob);
215220

216221
// verify Bob
217222
await verify(app, bob);
@@ -257,5 +262,41 @@ test.describe("Cryptography", function () {
257262
page.locator(".mx_EventTile", { hasText: "Hee!" }).locator(".mx_EventTile_e2eIcon_warning"),
258263
).not.toBeVisible();
259264
});
265+
266+
test("should show correct shields on events sent by devices which have since been deleted", async ({
267+
page,
268+
app,
269+
bot: bob,
270+
homeserver,
271+
}) => {
272+
// Our app is blocked from syncing while Bob sends his messages.
273+
await app.client.network.goOffline();
274+
275+
// Bob sends a message from his verified device
276+
await bob.sendMessage(testRoomId, "test encrypted from verified");
277+
278+
// And one from a second, not cross-signed, device
279+
const bobSecondDevice = await createSecondBotDevice(page, homeserver, bob);
280+
await bobSecondDevice.waitForNextSync(); // make sure the client knows the room is encrypted
281+
await bobSecondDevice.sendMessage(testRoomId, "test encrypted from unverified");
282+
283+
// ... and then logs out both devices.
284+
await bob.evaluate((cli) => cli.logout(true));
285+
await bobSecondDevice.evaluate((cli) => cli.logout(true));
286+
287+
// Let our app start syncing again
288+
await app.client.network.goOnline();
289+
290+
// Wait for the messages to arrive
291+
const last = page.locator(".mx_EventTile_last");
292+
await expect(last).toContainText("test encrypted from unverified");
293+
const lastE2eIcon = last.locator(".mx_EventTile_e2eIcon");
294+
await expect(lastE2eIcon).toHaveClass(/mx_EventTile_e2eIcon_warning/);
295+
await lastE2eIcon.focus();
296+
await expect(page.getByRole("tooltip")).toContainText("Encrypted by a device not verified by its owner.");
297+
298+
const penultimate = page.locator(".mx_EventTile").filter({ hasText: "test encrypted from verified" });
299+
await expect(penultimate.locator(".mx_EventTile_e2eIcon")).not.toBeVisible();
300+
});
260301
});
261302
});

0 commit comments

Comments
 (0)