Skip to content

Commit ae33cfe

Browse files
committed
Merge tag 'v3.64.1' into sc
* Fix crash in older browsers (replace .at() with array.length-1) ([\matrix-org#9933](matrix-org#9933)). Fixes matrix-org/element-web-rageshakes#19281.
2 parents be6ad48 + 8219e44 commit ae33cfe

File tree

772 files changed

+15530
-5625
lines changed

Some content is hidden

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

772 files changed

+15530
-5625
lines changed

.eslintrc.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ module.exports = {
102102
rules: {
103103
// temporary disabled
104104
"@typescript-eslint/explicit-function-return-type": "off",
105-
"@typescript-eslint/explicit-member-accessibility": "off",
106105

107106
// Things we do that break the ideal style
108107
"prefer-promise-reject-errors": "off",
@@ -157,6 +156,14 @@ module.exports = {
157156
"@typescript-eslint/no-var-requires": "off",
158157
},
159158
},
159+
{
160+
files: ["test/**/*.{ts,tsx}", "cypress/**/*.ts"],
161+
rules: {
162+
// We don't need super strict typing in test utilities
163+
"@typescript-eslint/explicit-function-return-type": "off",
164+
"@typescript-eslint/explicit-member-accessibility": "off",
165+
},
166+
},
160167
],
161168
settings: {
162169
react: {

.git-blame-ignore-revs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# prettier
2+
526645c79160ab1ad4b4c3845de27d51263a405e

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ package-lock.json
2525
/cypress/downloads
2626
/cypress/screenshots
2727
/cypress/synapselogs
28+
/cypress/dendritelogs
2829
# These could have files in them but don't currently
2930
# Cypress will still auto-create them though...
3031
/cypress/performance

CHANGELOG.md

+64
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,67 @@
1+
Changes in [3.64.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.64.1) (2023-01-18)
2+
=====================================================================================================
3+
4+
## 🐛 Bug Fixes
5+
* Fix crash in older browsers (replace .at() with array.length-1) ([\#9933](https://github.com/matrix-org/matrix-react-sdk/pull/9933)). Fixes matrix-org/element-web-rageshakes#19281.
6+
7+
Changes in [3.64.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.64.0) (2023-01-18)
8+
=====================================================================================================
9+
10+
## ✨ Features
11+
* Switch threads on for everyone ([\#9879](https://github.com/matrix-org/matrix-react-sdk/pull/9879)).
12+
* Make threads use new UTD UI ([\#9876](https://github.com/matrix-org/matrix-react-sdk/pull/9876)). Fixes vector-im/element-web#24060.
13+
* Add edit and remove actions to link in RTE ([\#9864](https://github.com/matrix-org/matrix-react-sdk/pull/9864)).
14+
* Remove extensible events v1 experimental rendering ([\#9881](https://github.com/matrix-org/matrix-react-sdk/pull/9881)).
15+
* Make create poll dialog scale better (PSG-929) ([\#9873](https://github.com/matrix-org/matrix-react-sdk/pull/9873)). Fixes vector-im/element-web#21855.
16+
* Change RTE mode icons ([\#9861](https://github.com/matrix-org/matrix-react-sdk/pull/9861)).
17+
* Device manager - prune client information events after remote sign out ([\#9874](https://github.com/matrix-org/matrix-react-sdk/pull/9874)).
18+
* Check connection before starting broadcast ([\#9857](https://github.com/matrix-org/matrix-react-sdk/pull/9857)).
19+
* Enable sent receipt for poll start events (PSG-962) ([\#9870](https://github.com/matrix-org/matrix-react-sdk/pull/9870)).
20+
* Change clear notifications to have more readable copy ([\#9867](https://github.com/matrix-org/matrix-react-sdk/pull/9867)).
21+
* Combine search results when the query is present in multiple successive messages ([\#9855](https://github.com/matrix-org/matrix-react-sdk/pull/9855)). Fixes vector-im/element-web#3977. Contributed by @grimhilt.
22+
* Disable bubbles for broadcasts ([\#9860](https://github.com/matrix-org/matrix-react-sdk/pull/9860)). Fixes vector-im/element-web#24140.
23+
* Enable reactions and replies for broadcasts ([\#9856](https://github.com/matrix-org/matrix-react-sdk/pull/9856)). Fixes vector-im/element-web#24042.
24+
* Improve switching between rich and plain editing modes ([\#9776](https://github.com/matrix-org/matrix-react-sdk/pull/9776)).
25+
* Redesign the picture-in-picture window ([\#9800](https://github.com/matrix-org/matrix-react-sdk/pull/9800)). Fixes vector-im/element-web#23980.
26+
* User on-boarding tasks now appear in a static order. ([\#9799](https://github.com/matrix-org/matrix-react-sdk/pull/9799)). Contributed by @GoodGuyMarco.
27+
* Device manager - contextual menus ([\#9832](https://github.com/matrix-org/matrix-react-sdk/pull/9832)).
28+
* If listening a non-live broadcast and changing the room, the broadcast will be paused ([\#9825](https://github.com/matrix-org/matrix-react-sdk/pull/9825)). Fixes vector-im/element-web#24078.
29+
* Consider own broadcasts from other device as a playback ([\#9821](https://github.com/matrix-org/matrix-react-sdk/pull/9821)). Fixes vector-im/element-web#24068.
30+
* Add link creation to rich text editor ([\#9775](https://github.com/matrix-org/matrix-react-sdk/pull/9775)).
31+
* Add mark as read option in room setting ([\#9798](https://github.com/matrix-org/matrix-react-sdk/pull/9798)). Fixes vector-im/element-web#24053.
32+
* Device manager - current device design and copy tweaks ([\#9801](https://github.com/matrix-org/matrix-react-sdk/pull/9801)).
33+
* Unify notifications panel event design ([\#9754](https://github.com/matrix-org/matrix-react-sdk/pull/9754)).
34+
* Add actions for integration manager to send and read certain events ([\#9740](https://github.com/matrix-org/matrix-react-sdk/pull/9740)).
35+
* Device manager - design tweaks ([\#9768](https://github.com/matrix-org/matrix-react-sdk/pull/9768)).
36+
* Change room list sorting to activity and unread first by default ([\#9773](https://github.com/matrix-org/matrix-react-sdk/pull/9773)). Fixes vector-im/element-web#24014.
37+
* Add a config flag to enable the rust crypto-sdk ([\#9759](https://github.com/matrix-org/matrix-react-sdk/pull/9759)).
38+
* Improve decryption error UI by consolidating error messages and providing instructions when possible ([\#9544](https://github.com/matrix-org/matrix-react-sdk/pull/9544)).
39+
* Honor font settings in Element Call ([\#9751](https://github.com/matrix-org/matrix-react-sdk/pull/9751)). Fixes vector-im/element-web#23661.
40+
* Device manager - use deleteAccountData to prune device manager client information events ([\#9734](https://github.com/matrix-org/matrix-react-sdk/pull/9734)).
41+
42+
## 🐛 Bug Fixes
43+
* Display rooms & threads as unread (bold) if threads have unread messages. ([\#9763](https://github.com/matrix-org/matrix-react-sdk/pull/9763)). Fixes vector-im/element-web#23907.
44+
* Don't prefer STIXGeneral over the default font ([\#9711](https://github.com/matrix-org/matrix-react-sdk/pull/9711)). Fixes vector-im/element-web#23899.
45+
* Use the same avatar colour when creating 1:1 DM rooms ([\#9850](https://github.com/matrix-org/matrix-react-sdk/pull/9850)). Fixes vector-im/element-web#23476.
46+
* Fix space lock icon size ([\#9854](https://github.com/matrix-org/matrix-react-sdk/pull/9854)). Fixes vector-im/element-web#24128.
47+
* Make calls automatically disconnect if the widget disappears ([\#9862](https://github.com/matrix-org/matrix-react-sdk/pull/9862)). Fixes vector-im/element-web#23664.
48+
* Fix emoji in RTE editing ([\#9827](https://github.com/matrix-org/matrix-react-sdk/pull/9827)).
49+
* Fix export with attachments on formats txt and json ([\#9851](https://github.com/matrix-org/matrix-react-sdk/pull/9851)). Fixes vector-im/element-web#24130. Contributed by @grimhilt.
50+
* Fixed empty `Content-Type` for encrypted uploads ([\#9848](https://github.com/matrix-org/matrix-react-sdk/pull/9848)). Contributed by @K3das.
51+
* Fix sign-in instead link on password reset page ([\#9820](https://github.com/matrix-org/matrix-react-sdk/pull/9820)). Fixes vector-im/element-web#24087.
52+
* The seekbar now initially shows the current position ([\#9796](https://github.com/matrix-org/matrix-react-sdk/pull/9796)). Fixes vector-im/element-web#24051.
53+
* Fix: Editing a poll will silently change it to a closed poll ([\#9809](https://github.com/matrix-org/matrix-react-sdk/pull/9809)). Fixes vector-im/element-web#23176.
54+
* Make call tiles look less broken in the right panel ([\#9808](https://github.com/matrix-org/matrix-react-sdk/pull/9808)). Fixes vector-im/element-web#23716.
55+
* Prevent unnecessary m.direct updates ([\#9805](https://github.com/matrix-org/matrix-react-sdk/pull/9805)). Fixes vector-im/element-web#24059.
56+
* Fix checkForPreJoinUISI for thread roots ([\#9803](https://github.com/matrix-org/matrix-react-sdk/pull/9803)). Fixes vector-im/element-web#24054.
57+
* Snap in PiP widget when content changed ([\#9797](https://github.com/matrix-org/matrix-react-sdk/pull/9797)). Fixes vector-im/element-web#24050.
58+
* Load RTE components only when RTE labs is enabled ([\#9804](https://github.com/matrix-org/matrix-react-sdk/pull/9804)).
59+
* Ensure that events are correctly updated when they are edited. ([\#9789](https://github.com/matrix-org/matrix-react-sdk/pull/9789)).
60+
* When stopping a broadcast also stop the playback ([\#9795](https://github.com/matrix-org/matrix-react-sdk/pull/9795)). Fixes vector-im/element-web#24052.
61+
* Prevent to start two broadcasts at the same time ([\#9744](https://github.com/matrix-org/matrix-react-sdk/pull/9744)). Fixes vector-im/element-web#23973.
62+
* Correctly handle limited sync responses by resetting the thread timeline ([\#3056](https://github.com/matrix-org/matrix-js-sdk/pull/3056)). Fixes vector-im/element-web#23952.
63+
* Fix failure to start in firefox private browser ([\#3058](https://github.com/matrix-org/matrix-js-sdk/pull/3058)). Fixes vector-im/element-web#24216.
64+
165
Changes in [3.63.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.63.0) (2022-12-21)
266
=====================================================================================================
367

__mocks__/maplibre-gl.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class MockMap extends EventEmitter {
2828
}
2929
const MockMapInstance = new MockMap();
3030

31+
class MockAttributionControl {}
3132
class MockGeolocateControl extends EventEmitter {
3233
trigger = jest.fn();
3334
}
@@ -43,5 +44,5 @@ module.exports = {
4344
LngLat,
4445
LngLatBounds,
4546
NavigationControl,
46-
AttributionControl,
47+
AttributionControl: MockAttributionControl,
4748
};

cypress-ci-reporter-config.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"reporterEnabled": "spec, mocha-junit-reporter",
3+
"mochaJunitReporterReporterOptions": {
4+
"mochaFile": "cypress/results/results-[hash].xml",
5+
"useFullSuiteTitle": true
6+
}
7+
}

cypress.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default defineConfig({
3333
env: {
3434
// Docker tag to use for `ghcr.io/matrix-org/sliding-sync-proxy` image.
3535
SLIDING_SYNC_PROXY_TAG: "v0.6.0",
36+
HOMESERVER: "synapse",
3637
},
3738
retries: {
3839
runMode: 4,

cypress/e2e/composer/composer.spec.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@ limitations under the License.
1616

1717
/// <reference types="cypress" />
1818

19-
import { SynapseInstance } from "../../plugins/synapsedocker";
19+
import { HomeserverInstance } from "../../plugins/utils/homeserver";
2020
import { SettingLevel } from "../../../src/settings/SettingLevel";
2121

2222
describe("Composer", () => {
23-
let synapse: SynapseInstance;
23+
let homeserver: HomeserverInstance;
2424

2525
beforeEach(() => {
26-
cy.startSynapse("default").then((data) => {
27-
synapse = data;
26+
cy.startHomeserver("default").then((data) => {
27+
homeserver = data;
2828
});
2929
});
3030

3131
afterEach(() => {
32-
cy.stopSynapse(synapse);
32+
cy.stopHomeserver(homeserver);
3333
});
3434

3535
describe("CIDER", () => {
3636
beforeEach(() => {
37-
cy.initTestUser(synapse, "Janet").then(() => {
37+
cy.initTestUser(homeserver, "Janet").then(() => {
3838
cy.createRoom({ name: "Composing Room" });
3939
});
4040
cy.viewRoomByName("Composing Room");
@@ -101,7 +101,7 @@ describe("Composer", () => {
101101
describe("WYSIWYG", () => {
102102
beforeEach(() => {
103103
cy.enableLabsFeature("feature_wysiwyg_composer");
104-
cy.initTestUser(synapse, "Janet").then(() => {
104+
cy.initTestUser(homeserver, "Janet").then(() => {
105105
cy.createRoom({ name: "Composing Room" });
106106
});
107107
cy.viewRoomByName("Composing Room");

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ limitations under the License.
1616

1717
/// <reference types="cypress" />
1818

19-
import { SynapseInstance } from "../../plugins/synapsedocker";
19+
import { HomeserverInstance } from "../../plugins/utils/homeserver";
2020
import Chainable = Cypress.Chainable;
2121

2222
function openCreateRoomDialog(): Chainable<JQuery<HTMLElement>> {
@@ -26,18 +26,18 @@ function openCreateRoomDialog(): Chainable<JQuery<HTMLElement>> {
2626
}
2727

2828
describe("Create Room", () => {
29-
let synapse: SynapseInstance;
29+
let homeserver: HomeserverInstance;
3030

3131
beforeEach(() => {
32-
cy.startSynapse("default").then((data) => {
33-
synapse = data;
32+
cy.startHomeserver("default").then((data) => {
33+
homeserver = data;
3434

35-
cy.initTestUser(synapse, "Jim");
35+
cy.initTestUser(homeserver, "Jim");
3636
});
3737
});
3838

3939
afterEach(() => {
40-
cy.stopSynapse(synapse);
40+
cy.stopHomeserver(homeserver);
4141
});
4242

4343
it("should allow us to create a public room with name, topic & address set", () => {

cypress/e2e/crypto/crypto.spec.ts

+93-12
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
import { MatrixClient, Room } from "matrix-js-sdk/src/matrix";
18-
17+
import type { ISendEventResponse, MatrixClient, Room } from "matrix-js-sdk/src/matrix";
1918
import type { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest";
2019
import type { ISasEvent } from "matrix-js-sdk/src/crypto/verification/SAS";
21-
import { SynapseInstance } from "../../plugins/synapsedocker";
20+
import type { CypressBot } from "../../support/bot";
21+
import { HomeserverInstance } from "../../plugins/utils/homeserver";
2222
import Chainable = Cypress.Chainable;
2323

2424
type EmojiMapping = [emoji: string, name: string];
2525
interface CryptoTestContext extends Mocha.Context {
26-
synapse: SynapseInstance;
27-
bob: MatrixClient;
26+
homeserver: HomeserverInstance;
27+
bob: CypressBot;
2828
}
2929

3030
const waitForVerificationRequest = (cli: MatrixClient): Promise<VerificationRequest> => {
@@ -155,16 +155,16 @@ const verify = function (this: CryptoTestContext) {
155155

156156
describe("Cryptography", function () {
157157
beforeEach(function () {
158-
cy.startSynapse("default")
159-
.as("synapse")
160-
.then((synapse: SynapseInstance) => {
161-
cy.initTestUser(synapse, "Alice");
162-
cy.getBot(synapse, { displayName: "Bob", autoAcceptInvites: false }).as("bob");
158+
cy.startHomeserver("default")
159+
.as("homeserver")
160+
.then((homeserver: HomeserverInstance) => {
161+
cy.initTestUser(homeserver, "Alice", undefined, "alice_");
162+
cy.getBot(homeserver, { displayName: "Bob", autoAcceptInvites: false, userIdPrefix: "bob_" }).as("bob");
163163
});
164164
});
165165

166166
afterEach(function (this: CryptoTestContext) {
167-
cy.stopSynapse(this.synapse);
167+
cy.stopHomeserver(this.homeserver);
168168
});
169169

170170
it("setting up secure key backup should work", () => {
@@ -197,7 +197,7 @@ describe("Cryptography", function () {
197197
cy.bootstrapCrossSigning();
198198
autoJoin(this.bob);
199199

200-
/* we need to have a room with the other user present, so we can open the verification panel */
200+
// we need to have a room with the other user present, so we can open the verification panel
201201
let roomId: string;
202202
cy.createRoom({ name: "TestRoom", invite: [this.bob.getUserId()] }).then((_room1Id) => {
203203
roomId = _room1Id;
@@ -210,4 +210,85 @@ describe("Cryptography", function () {
210210

211211
verify.call(this);
212212
});
213+
214+
it("should show the correct shield on edited e2e events", function (this: CryptoTestContext) {
215+
cy.bootstrapCrossSigning();
216+
217+
// bob has a second, not cross-signed, device
218+
cy.loginBot(this.homeserver, this.bob.getUserId(), this.bob.__cypress_password, {}).as("bobSecondDevice");
219+
220+
autoJoin(this.bob);
221+
222+
// first create the room, so that we can open the verification panel
223+
cy.createRoom({ name: "TestRoom", invite: [this.bob.getUserId()] })
224+
.as("testRoomId")
225+
.then((roomId) => {
226+
cy.log(`Created test room ${roomId}`);
227+
cy.visit(`/#/room/${roomId}`);
228+
229+
// enable encryption
230+
cy.getClient().then((cli) => {
231+
cli.sendStateEvent(roomId, "m.room.encryption", { algorithm: "m.megolm.v1.aes-sha2" });
232+
});
233+
234+
// wait for Bob to join the room, otherwise our attempt to open his user details may race
235+
// with his join.
236+
cy.contains(".mx_TextualEvent", "Bob joined the room").should("exist");
237+
});
238+
239+
verify.call(this);
240+
241+
cy.get<string>("@testRoomId").then((roomId) => {
242+
// bob sends a valid event
243+
cy.wrap(this.bob.sendTextMessage(roomId, "Hoo!")).as("testEvent");
244+
245+
// the message should appear, decrypted, with no warning
246+
cy.contains(".mx_EventTile_body", "Hoo!")
247+
.closest(".mx_EventTile")
248+
.should("have.class", "mx_EventTile_verified")
249+
.should("not.have.descendants", ".mx_EventTile_e2eIcon_warning");
250+
251+
// bob sends an edit to the first message with his unverified device
252+
cy.get<MatrixClient>("@bobSecondDevice").then((bobSecondDevice) => {
253+
cy.get<ISendEventResponse>("@testEvent").then((testEvent) => {
254+
bobSecondDevice.sendMessage(roomId, {
255+
"m.new_content": {
256+
msgtype: "m.text",
257+
body: "Haa!",
258+
},
259+
"m.relates_to": {
260+
rel_type: "m.replace",
261+
event_id: testEvent.event_id,
262+
},
263+
});
264+
});
265+
});
266+
267+
// the edit should have a warning
268+
cy.contains(".mx_EventTile_body", "Haa!")
269+
.closest(".mx_EventTile")
270+
.within(() => {
271+
cy.get(".mx_EventTile_e2eIcon_warning").should("exist");
272+
});
273+
274+
// a second edit from the verified device should be ok
275+
cy.get<ISendEventResponse>("@testEvent").then((testEvent) => {
276+
this.bob.sendMessage(roomId, {
277+
"m.new_content": {
278+
msgtype: "m.text",
279+
body: "Hee!",
280+
},
281+
"m.relates_to": {
282+
rel_type: "m.replace",
283+
event_id: testEvent.event_id,
284+
},
285+
});
286+
});
287+
288+
cy.contains(".mx_EventTile_body", "Hee!")
289+
.closest(".mx_EventTile")
290+
.should("have.class", "mx_EventTile_verified")
291+
.should("not.have.descendants", ".mx_EventTile_e2eIcon_warning");
292+
});
293+
});
213294
});

0 commit comments

Comments
 (0)