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

Commit 47b5ff5

Browse files
committed
Merge branch 'develop' into staging
2 parents ae8311f + 1b806bb commit 47b5ff5

File tree

542 files changed

+10281
-10144
lines changed

Some content is hidden

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

542 files changed

+10281
-10144
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ indent_size = 4
2323
trim_trailing_whitespace = true
2424

2525
[*.{yml,yaml}]
26-
indent_size = 2
26+
indent_size = 4

.eslintrc.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,17 +165,43 @@ module.exports = {
165165
},
166166
{
167167
files: ["test/**/*.{ts,tsx}", "cypress/**/*.ts"],
168+
extends: ["plugin:matrix-org/jest"],
168169
rules: {
169170
// We don't need super strict typing in test utilities
170171
"@typescript-eslint/explicit-function-return-type": "off",
171172
"@typescript-eslint/explicit-member-accessibility": "off",
173+
174+
// Jest/Cypress specific
175+
176+
// Disabled tests are a reality for now but as soon as all of the xits are
177+
// eliminated, we should enforce this.
178+
"jest/no-disabled-tests": "off",
179+
// TODO: There are many tests with invalid expects that should be fixed,
180+
// https://github.com/vector-im/element-web/issues/24709
181+
"jest/valid-expect": "off",
182+
// TODO: There are many cases to refactor away,
183+
// https://github.com/vector-im/element-web/issues/24710
184+
"jest/no-conditional-expect": "off",
185+
// Also treat "oldBackendOnly" as a test function.
186+
// Used in some crypto tests.
187+
"jest/no-standalone-expect": [
188+
"error",
189+
{
190+
additionalTestBlockFunctions: ["beforeAll", "beforeEach", "oldBackendOnly"],
191+
},
192+
],
172193
},
173194
},
174195
{
175196
files: ["cypress/**/*.ts"],
176197
parserOptions: {
177198
project: ["./cypress/tsconfig.json"],
178199
},
200+
rules: {
201+
// Cypress "promises" work differently - disable some related rules
202+
"jest/valid-expect-in-promise": "off",
203+
"jest/no-done-callback": "off",
204+
},
179205
},
180206
],
181207
settings: {

.github/workflows/cypress.yaml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
workflows: ["Element Web - Build"]
66
types:
77
- completed
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.ref }}
10+
cancel-in-progress: ${{ github.event.workflow_run.event == 'pull_request' }}
811
jobs:
912
prepare:
1013
name: Prepare
@@ -119,7 +122,7 @@ jobs:
119122
path: webapp
120123

121124
- name: Run Cypress tests
122-
uses: cypress-io/github-action@v5.0.2
125+
uses: cypress-io/github-action@v5.1.0
123126
with:
124127
# The built-in Electron runner seems to grind to a halt trying
125128
# to run the tests, so use chrome.
@@ -162,8 +165,9 @@ jobs:
162165
PERCY_BRANCH: ${{ github.event.workflow_run.head_branch }}
163166
PERCY_COMMIT: ${{ github.event.workflow_run.head_sha }}
164167
PERCY_PULL_REQUEST: ${{ needs.prepare.outputs.pr_id }}
165-
PERCY_PARALLEL_TOTAL: ${{ strategy.job-total }}
166168
PERCY_PARALLEL_NONCE: ${{ needs.prepare.outputs.uuid }}
169+
# We manually finalize the build in the report stage
170+
PERCY_PARALLEL_TOTAL: -1
167171

168172
- name: Upload Artifact
169173
if: failure()
@@ -181,21 +185,43 @@ jobs:
181185
with:
182186
name: cypress-junit
183187
path: cypress/results
188+
184189
report:
185190
name: Report results
186-
needs: tests
191+
needs:
192+
- prepare
193+
- tests
187194
runs-on: ubuntu-latest
188195
if: always()
189196
permissions:
190197
statuses: write
191198
steps:
199+
- name: Finalize Percy
200+
if: needs.prepare.outputs.percy_enable == '1'
201+
run: npx -p @percy/cli percy build:finalize
202+
env:
203+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
204+
PERCY_PARALLEL_NONCE: ${{ needs.prepare.outputs.uuid }}
205+
206+
- name: Skip Percy required check
207+
if: needs.prepare.outputs.percy_enable != '1'
208+
uses: Sibz/github-status-action@v1
209+
with:
210+
authToken: ${{ secrets.GITHUB_TOKEN }}
211+
state: success
212+
description: Percy skipped
213+
context: percy/matrix-react-sdk
214+
sha: ${{ github.event.workflow_run.head_sha }}
215+
target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
216+
192217
- uses: Sibz/github-status-action@v1
193218
with:
194219
authToken: ${{ secrets.GITHUB_TOKEN }}
195220
state: ${{ needs.tests.result == 'success' && 'success' || 'failure' }}
196221
context: ${{ github.workflow }} / cypress (${{ github.event.workflow_run.event }} => ${{ github.event_name }})
197222
sha: ${{ github.event.workflow_run.head_sha }}
198223
target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
224+
199225
testrail:
200226
name: Report results to testrail
201227
needs:

.github/workflows/tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ jobs:
3939
env:
4040
JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }}
4141

42+
- name: Jest Cache
43+
uses: actions/cache@v3
44+
with:
45+
path: /tmp/jest_cache
46+
key: ${{ hashFiles('**/yarn.lock') }}
47+
4248
- name: Get number of CPU cores
4349
id: cpu-cores
4450
uses: SimenB/github-actions-cpu-cores@v1
@@ -54,7 +60,8 @@ jobs:
5460
yarn ${{ inputs.disable_coverage != 'true' && 'coverage' || 'test' }} \
5561
--ci \
5662
--reporters github-actions ${{ steps.metrics.outputs.extra-reporter }} \
57-
--max-workers ${{ steps.cpu-cores.outputs.count }}
63+
--max-workers ${{ steps.cpu-cores.outputs.count }} \
64+
--cacheDirectory /tmp/jest_cache
5865
5966
- name: Upload Artifact
6067
if: inputs.disable_coverage != 'true'

CHANGELOG.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@ Changes in [3.67.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/
22
=====================================================================================================
33

44
## ✨ Features
5-
* Fix block code styling in rich text editor ([\#10246](https://github.com/matrix-org/matrix-react-sdk/pull/10246)). Contributed by @alunturner.
6-
* Poll history: fetch more poll history ([\#10235](https://github.com/matrix-org/matrix-react-sdk/pull/10235)). Contributed by @kerryarchibald.
7-
* Sort short/exact emoji matches before longer incomplete matches ([\#10212](https://github.com/matrix-org/matrix-react-sdk/pull/10212)). Fixes vector-im/element-web#23210. Contributed by @grimhilt.
8-
* Poll history: detail screen ([\#10172](https://github.com/matrix-org/matrix-react-sdk/pull/10172)). Contributed by @kerryarchibald.
9-
* Provide a more detailed error message than "No known servers" ([\#6048](https://github.com/matrix-org/matrix-react-sdk/pull/6048)). Fixes vector-im/element-web#13247. Contributed by @aaronraimist.
10-
* Say when a call was answered from a different device ([\#10224](https://github.com/matrix-org/matrix-react-sdk/pull/10224)).
11-
* Widget permissions customizations using module api ([\#10121](https://github.com/matrix-org/matrix-react-sdk/pull/10121)). Contributed by @maheichyk.
12-
* Fix copy button icon overlapping with copyable text ([\#10227](https://github.com/matrix-org/matrix-react-sdk/pull/10227)). Contributed by @Adesh-Pandey.
13-
* Support joining non-peekable rooms via the module API ([\#10154](https://github.com/matrix-org/matrix-react-sdk/pull/10154)). Contributed by @maheichyk.
14-
* The "new login" toast does now display the same device information as in the settings. "No" does now open the device settings. "Yes, it was me" dismisses the toast. ([\#10200](https://github.com/matrix-org/matrix-react-sdk/pull/10200)).
15-
* Do not prompt for a password when doing a „reset all“ after login ([\#10208](https://github.com/matrix-org/matrix-react-sdk/pull/10208)).
165
* Display "The sender has blocked you from receiving this message" error message instead of "Unable to decrypt message" ([\#10202](https://github.com/matrix-org/matrix-react-sdk/pull/10202)). Contributed by @florianduros.
176
* Polls: show warning about undecryptable relations ([\#10179](https://github.com/matrix-org/matrix-react-sdk/pull/10179)). Contributed by @kerryarchibald.
187
* Poll history: fetch last 30 days of polls ([\#10157](https://github.com/matrix-org/matrix-react-sdk/pull/10157)). Contributed by @kerryarchibald.
@@ -25,11 +14,7 @@ Changes in [3.67.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/
2514
* Render poll end events in timeline ([\#10027](https://github.com/matrix-org/matrix-react-sdk/pull/10027)). Contributed by @kerryarchibald.
2615

2716
## 🐛 Bug Fixes
28-
* Use the room avatar as a placeholder in calls ([\#10231](https://github.com/matrix-org/matrix-react-sdk/pull/10231)).
29-
* Fix calls showing as 'connecting' after hangup ([\#10223](https://github.com/matrix-org/matrix-react-sdk/pull/10223)).
3017
* Stop access token overflowing the box ([\#10069](https://github.com/matrix-org/matrix-react-sdk/pull/10069)). Fixes vector-im/element-web#24023. Contributed by @sbjaj33.
31-
* Prevent multiple Jitsi calls started at the same time ([\#10183](https://github.com/matrix-org/matrix-react-sdk/pull/10183)). Fixes vector-im/element-web#23009.
32-
* Make localization keys compatible with agglutinative and/or SOV type languages ([\#10159](https://github.com/matrix-org/matrix-react-sdk/pull/10159)). Contributed by @luixxiul.
3318
* Add link to next file in the export ([\#10190](https://github.com/matrix-org/matrix-react-sdk/pull/10190)). Fixes vector-im/element-web#20272. Contributed by @grimhilt.
3419
* Ended poll tiles: add ended the poll message ([\#10193](https://github.com/matrix-org/matrix-react-sdk/pull/10193)). Fixes vector-im/element-web#24579. Contributed by @kerryarchibald.
3520
* Fix accidentally inverted condition for room ordering ([\#10178](https://github.com/matrix-org/matrix-react-sdk/pull/10178)). Fixes vector-im/element-web#24527. Contributed by @justjanne.

cypress/e2e/create-room/create-room.spec.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Matrix.org Foundation C.I.C.
2+
Copyright 2022-2023 The Matrix.org Foundation C.I.C.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -61,4 +61,31 @@ describe("Create Room", () => {
6161
cy.contains(".mx_RoomHeader_nametext", name);
6262
cy.contains(".mx_RoomHeader_topic", topic);
6363
});
64+
65+
it("should create a room with a long room name, which is displayed with ellipsis", () => {
66+
let roomId: string;
67+
const LONG_ROOM_NAME =
68+
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore " +
69+
"et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut " +
70+
"aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum " +
71+
"dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui " +
72+
"officia deserunt mollit anim id est laborum.";
73+
74+
cy.createRoom({ name: LONG_ROOM_NAME }).then((_roomId) => {
75+
roomId = _roomId;
76+
cy.visit("/#/room/" + roomId);
77+
});
78+
79+
// Wait until the room name is set
80+
cy.get(".mx_RoomHeader_nametext").contains("Lorem ipsum");
81+
82+
// Make sure size of buttons on RoomHeader (except .mx_RoomHeader_name) are specified
83+
// and the buttons are not compressed
84+
// TODO: use a same class name
85+
cy.get(".mx_RoomHeader_button").should("have.css", "height", "32px").should("have.css", "width", "32px");
86+
cy.get(".mx_HeaderButtons > .mx_RightPanel_headerButton")
87+
.should("have.css", "height", "32px")
88+
.should("have.css", "width", "32px");
89+
cy.get(".mx_RoomHeader").percySnapshotElement("Room header with a long room name");
90+
});
6491
});

cypress/e2e/crypto/decryption-failure.spec.ts

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ describe("Decryption Failure Bar", () => {
118118
"Verify this device to access all messages",
119119
);
120120

121-
cy.percySnapshot("DecryptionFailureBar prompts user to verify");
121+
cy.get(".mx_DecryptionFailureBar").percySnapshotElement(
122+
"DecryptionFailureBar prompts user to verify",
123+
{
124+
widths: [320, 640],
125+
},
126+
);
122127

123128
cy.contains(".mx_DecryptionFailureBar_button", "Resend key requests").should("not.exist");
124129
cy.contains(".mx_DecryptionFailureBar_button", "Verify").click();
@@ -146,17 +151,23 @@ describe("Decryption Failure Bar", () => {
146151
"Open another device to load encrypted messages",
147152
);
148153

149-
cy.percySnapshot(
154+
cy.get(".mx_DecryptionFailureBar").percySnapshotElement(
150155
"DecryptionFailureBar prompts user to open another device, with Resend Key Requests button",
156+
{
157+
widths: [320, 640],
158+
},
151159
);
152160

153161
cy.intercept("/_matrix/client/r0/sendToDevice/m.room_key_request/*").as("keyRequest");
154162
cy.contains(".mx_DecryptionFailureBar_button", "Resend key requests").click();
155163
cy.wait("@keyRequest");
156164
cy.contains(".mx_DecryptionFailureBar_button", "Resend key requests").should("not.exist");
157165

158-
cy.percySnapshot(
159-
"DecryptionFailureBar prompts user to open another device, " + "without Resend Key Requests button",
166+
cy.get(".mx_DecryptionFailureBar").percySnapshotElement(
167+
"DecryptionFailureBar prompts user to open another device, without Resend Key Requests button",
168+
{
169+
widths: [320, 640],
170+
},
160171
);
161172
},
162173
);
@@ -177,7 +188,9 @@ describe("Decryption Failure Bar", () => {
177188
"Reset your keys to prevent future decryption errors",
178189
);
179190

180-
cy.percySnapshot("DecryptionFailureBar prompts user to reset keys");
191+
cy.get(".mx_DecryptionFailureBar").percySnapshotElement("DecryptionFailureBar prompts user to reset keys", {
192+
widths: [320, 640],
193+
});
181194

182195
cy.contains(".mx_DecryptionFailureBar_button", "Reset").click();
183196

@@ -196,7 +209,12 @@ describe("Decryption Failure Bar", () => {
196209
"Some messages could not be decrypted",
197210
);
198211

199-
cy.percySnapshot("DecryptionFailureBar displays general message with no call to action");
212+
cy.get(".mx_DecryptionFailureBar").percySnapshotElement(
213+
"DecryptionFailureBar displays general message with no call to action",
214+
{
215+
widths: [320, 640],
216+
},
217+
);
200218
},
201219
);
202220

@@ -210,7 +228,10 @@ describe("Decryption Failure Bar", () => {
210228
cy.get(".mx_DecryptionFailureBar").should("exist");
211229
cy.get(".mx_DecryptionFailureBar .mx_Spinner").should("exist");
212230

213-
cy.percySnapshot("DecryptionFailureBar displays loading spinner");
231+
cy.get(".mx_DecryptionFailureBar").percySnapshotElement("DecryptionFailureBar displays loading spinner", {
232+
allowSpinners: true,
233+
widths: [320, 640],
234+
});
214235

215236
cy.wait(5000);
216237
cy.get(".mx_DecryptionFailureBar .mx_Spinner").should("not.exist");

cypress/e2e/polls/polls.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { HomeserverInstance } from "../../plugins/utils/homeserver";
2020
import { MatrixClient } from "../../global";
2121
import Chainable = Cypress.Chainable;
2222

23-
const hideTimestampCSS = ".mx_MessageTimestamp { visibility: hidden !important; }";
23+
const hidePercyCSS = ".mx_MessageTimestamp, .mx_RoomView_myReadMarker { visibility: hidden !important; }";
2424

2525
describe("Polls", () => {
2626
let homeserver: HomeserverInstance;
@@ -133,7 +133,7 @@ describe("Polls", () => {
133133
.as("pollId");
134134

135135
cy.get<string>("@pollId").then((pollId) => {
136-
getPollTile(pollId).percySnapshotElement("Polls Timeline tile - no votes", { percyCSS: hideTimestampCSS });
136+
getPollTile(pollId).percySnapshotElement("Polls Timeline tile - no votes", { percyCSS: hidePercyCSS });
137137

138138
// Bot votes 'Maybe' in the poll
139139
botVoteForOption(bot, roomId, pollId, pollParams.options[2]);

cypress/e2e/sliding-sync/sliding-sync.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ describe("Sliding Sync", () => {
356356
});
357357

358358
// Regression test for https://github.com/vector-im/element-web/issues/21462
359-
it("should not cancel replies when permalinks are clicked ", () => {
359+
it("should not cancel replies when permalinks are clicked", () => {
360360
cy.get<string>("@roomId").then((roomId) => {
361361
// we require a first message as you cannot click the permalink text with the avatar in the way
362362
return cy

cypress/e2e/spotlight/spotlight.spec.ts

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import Timeoutable = Cypress.Timeoutable;
2424
import Withinable = Cypress.Withinable;
2525
import Shadow = Cypress.Shadow;
2626

27-
export enum Filter {
27+
enum Filter {
2828
People = "people",
2929
PublicRooms = "public_rooms",
3030
}
@@ -297,27 +297,28 @@ describe("Spotlight", () => {
297297

298298
// TODO: We currently can’t test finding rooms on other homeservers/other protocols
299299
// We obviously don’t have federation or bridges in cypress tests
300-
/*
301-
const room3Name = "Matrix HQ";
302-
const room3Id = "#matrix:matrix.org";
303-
304-
it("should find unknown public rooms on other homeservers", () => {
305-
cy.openSpotlightDialog().within(() => {
306-
cy.spotlightFilter(Filter.PublicRooms);
307-
cy.spotlightSearch().clear().type(room3Name);
308-
cy.get("[aria-haspopup=true][role=button]").click();
309-
}).then(() => {
310-
cy.contains(".mx_GenericDropdownMenu_Option--header", "matrix.org")
311-
.next("[role=menuitemradio]")
312-
.click();
313-
cy.wait(3_600_000);
314-
}).then(() => cy.spotlightDialog().within(() => {
315-
cy.spotlightResults().should("have.length", 1);
316-
cy.spotlightResults().eq(0).should("contain", room3Name);
317-
cy.spotlightResults().eq(0).should("contain", room3Id);
318-
}));
300+
it.skip("should find unknown public rooms on other homeservers", () => {
301+
cy.openSpotlightDialog()
302+
.within(() => {
303+
cy.spotlightFilter(Filter.PublicRooms);
304+
cy.spotlightSearch().clear().type(room3Name);
305+
cy.get("[aria-haspopup=true][role=button]").click();
306+
})
307+
.then(() => {
308+
cy.contains(".mx_GenericDropdownMenu_Option--header", "matrix.org")
309+
.next("[role=menuitemradio]")
310+
.click();
311+
cy.wait(3_600_000);
312+
})
313+
.then(() =>
314+
cy.spotlightDialog().within(() => {
315+
cy.spotlightResults().should("have.length", 1);
316+
cy.spotlightResults().eq(0).should("contain", room3Name);
317+
cy.spotlightResults().eq(0).should("contain", room3Id);
318+
}),
319+
);
319320
});
320-
*/
321+
321322
it("should find known people", () => {
322323
cy.openSpotlightDialog()
323324
.within(() => {

0 commit comments

Comments
 (0)