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

Commit dd405ea

Browse files
committed
Merge remote-tracking branch 'origin/develop' into staging
2 parents cd850f5 + f33e802 commit dd405ea

File tree

135 files changed

+1602
-556
lines changed

Some content is hidden

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

135 files changed

+1602
-556
lines changed

.eslintrc.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ module.exports = {
122122
"!matrix-js-sdk/src/crypto/aes",
123123
"!matrix-js-sdk/src/crypto/keybackup",
124124
"!matrix-js-sdk/src/crypto/deviceinfo",
125-
"!matrix-js-sdk/src/crypto/key_passphrase",
126-
"!matrix-js-sdk/src/crypto/recoverykey",
127125
"!matrix-js-sdk/src/crypto/dehydration",
128126
"!matrix-js-sdk/src/oidc",
129127
"!matrix-js-sdk/src/oidc/discovery",

.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: 5 additions & 5 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",
@@ -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",
@@ -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,7 @@
198198
"axe-core": "4.10.0",
199199
"babel-jest": "^29.0.0",
200200
"blob-polyfill": "^9.0.0",
201-
"eslint": "8.57.0",
201+
"eslint": "8.57.1",
202202
"eslint-config-google": "^0.14.0",
203203
"eslint-config-prettier": "^9.0.0",
204204
"eslint-plugin-deprecate": "0.8.5",
@@ -235,7 +235,7 @@
235235
"stylelint-config-standard": "^36.0.0",
236236
"stylelint-scss": "^6.0.0",
237237
"ts-node": "^10.9.1",
238-
"typescript": "5.5.4",
238+
"typescript": "5.6.2",
239239
"web-streams-polyfill": "^4.0.0"
240240
},
241241
"peerDependencies": {

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

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
66
Please see LICENSE files in the repository root for full details.
77
*/
88

9-
import { Page } from "@playwright/test";
10-
119
import { expect, test } from "../../element-web-test";
12-
import { autoJoin, createSharedRoomWithUser, enableKeyBackup, logIntoElement, logOutOfElement, verify } from "./utils";
13-
import { Bot } from "../../pages/bot";
14-
import { HomeserverInstance } from "../../plugins/homeserver";
10+
import {
11+
autoJoin,
12+
createSecondBotDevice,
13+
createSharedRoomWithUser,
14+
enableKeyBackup,
15+
logIntoElement,
16+
logOutOfElement,
17+
verify,
18+
} from "./utils";
1519

1620
test.describe("Cryptography", function () {
1721
test.use({
@@ -296,13 +300,3 @@ test.describe("Cryptography", function () {
296300
});
297301
});
298302
});
299-
300-
async function createSecondBotDevice(page: Page, homeserver: HomeserverInstance, bob: Bot) {
301-
const bobSecondDevice = new Bot(page, homeserver, {
302-
bootstrapSecretStorage: false,
303-
bootstrapCrossSigning: false,
304-
});
305-
bobSecondDevice.setCredentials(await homeserver.loginUser(bob.credentials.userId, bob.credentials.password));
306-
await bobSecondDevice.prepareClient();
307-
return bobSecondDevice;
308-
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
Copyright 2024 New Vector Ltd.
3+
4+
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
5+
Please see LICENSE files in the repository root for full details.
6+
*/
7+
8+
import { expect, test } from "../../element-web-test";
9+
import { autoJoin, createSecondBotDevice, createSharedRoomWithUser, verify } from "./utils";
10+
import { bootstrapCrossSigningForClient } from "../../pages/client.ts";
11+
12+
/** Tests for the "invisible crypto" behaviour -- i.e., when the "exclude insecure devices" setting is enabled */
13+
test.describe("Invisible cryptography", () => {
14+
test.use({
15+
displayName: "Alice",
16+
botCreateOpts: { displayName: "Bob" },
17+
labsFlags: ["feature_exclude_insecure_devices"],
18+
});
19+
20+
test("Messages fail to decrypt when sender is previously verified", async ({
21+
page,
22+
bot: bob,
23+
user: aliceCredentials,
24+
app,
25+
homeserver,
26+
}) => {
27+
await app.client.bootstrapCrossSigning(aliceCredentials);
28+
await autoJoin(bob);
29+
30+
// create an encrypted room
31+
const testRoomId = await createSharedRoomWithUser(app, bob.credentials.userId, {
32+
name: "TestRoom",
33+
initial_state: [
34+
{
35+
type: "m.room.encryption",
36+
state_key: "",
37+
content: {
38+
algorithm: "m.megolm.v1.aes-sha2",
39+
},
40+
},
41+
],
42+
});
43+
44+
// Verify Bob
45+
await verify(app, bob);
46+
47+
// Bob logs in a new device and resets cross-signing
48+
const bobSecondDevice = await createSecondBotDevice(page, homeserver, bob);
49+
await bootstrapCrossSigningForClient(await bobSecondDevice.prepareClient(), bob.credentials, true);
50+
51+
/* should show an error for a message from a previously verified device */
52+
await bobSecondDevice.sendMessage(testRoomId, "test encrypted from user that was previously verified");
53+
const lastTile = page.locator(".mx_EventTile_last");
54+
await expect(lastTile).toContainText("Verified identity has changed");
55+
});
56+
});

playwright/e2e/crypto/utils.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,3 +377,14 @@ export async function awaitVerifier(
377377
return verificationRequest.verifier;
378378
});
379379
}
380+
381+
/** Log in a second device for the given bot user */
382+
export async function createSecondBotDevice(page: Page, homeserver: HomeserverInstance, bob: Bot) {
383+
const bobSecondDevice = new Bot(page, homeserver, {
384+
bootstrapSecretStorage: false,
385+
bootstrapCrossSigning: false,
386+
});
387+
bobSecondDevice.setCredentials(await homeserver.loginUser(bob.credentials.userId, bob.credentials.password));
388+
await bobSecondDevice.prepareClient();
389+
return bobSecondDevice;
390+
}

0 commit comments

Comments
 (0)