Skip to content

Commit

Permalink
Merge tag 'v3.65.0' into sc
Browse files Browse the repository at this point in the history
* Quotes for rte ([\matrix-org#9932](matrix-org#9932)). Contributed by @alunturner.
* Show the room name in the room header during calls ([\matrix-org#9942](matrix-org#9942)). Fixes element-hq/element-web#24268.
* Add code blocks to rich text editor ([\matrix-org#9921](matrix-org#9921)). Contributed by @alunturner.
* Add new style for inline code ([\matrix-org#9936](matrix-org#9936)). Contributed by @florianduros.
* Add disabled button state to rich text editor ([\matrix-org#9930](matrix-org#9930)). Contributed by @alunturner.
* Change the rageshake "app" for auto-rageshakes ([\matrix-org#9909](matrix-org#9909)).
* Device manager - tweak settings display ([\matrix-org#9905](matrix-org#9905)). Contributed by @kerryarchibald.
* Add list functionality to rich text editor ([\matrix-org#9871](matrix-org#9871)). Contributed by @alunturner.
* Fix RTE focus behaviour in threads ([\matrix-org#9969](matrix-org#9969)). Fixes element-hq/element-web#23755. Contributed by @florianduros.
* #22204 Issue: Centered File info in lightbox ([\matrix-org#9971](matrix-org#9971)). Fixes element-hq/element-web#22204. Contributed by @Spartan09.
* Fix seekbar position for zero length audio ([\matrix-org#9949](matrix-org#9949)). Fixes element-hq/element-web#24248.
* Allow thread panel to be closed after being opened from notification ([\matrix-org#9937](matrix-org#9937)). Fixes element-hq/element-web#23764 element-hq/element-web#23852 and element-hq/element-web#24213. Contributed by @justjanne.
* Only highlight focused menu item if focus is supposed to be visible ([\matrix-org#9945](matrix-org#9945)). Fixes element-hq/element-web#23582.
* Prevent call durations from breaking onto multiple lines ([\matrix-org#9944](matrix-org#9944)).
* Tweak call lobby buttons to more closely match designs ([\matrix-org#9943](matrix-org#9943)).
* Do not show a broadcast as live immediately after the recording has stopped ([\matrix-org#9947](matrix-org#9947)). Fixes element-hq/element-web#24233.
* Clear the RTE before sending a message ([\matrix-org#9948](matrix-org#9948)). Contributed by @florianduros.
* Fix {enter} press in RTE ([\matrix-org#9927](matrix-org#9927)). Contributed by @florianduros.
* Fix the problem that the password reset email has to be confirmed twice ([\matrix-org#9926](matrix-org#9926)). Fixes element-hq/element-web#24226.
* replace .at() with array.length-1 ([\matrix-org#9933](matrix-org#9933)). Fixes matrix-org/element-web-rageshakes#19281.
* Fix broken threads list timestamp layout ([\matrix-org#9922](matrix-org#9922)). Fixes element-hq/element-web#24243 and element-hq/element-web#24191. Contributed by @justjanne.
* Disable multiple messages when {enter} is pressed multiple times ([\matrix-org#9929](matrix-org#9929)). Fixes element-hq/element-web#24249. Contributed by @florianduros.
* Fix logout devices when resetting the password ([\matrix-org#9925](matrix-org#9925)). Fixes element-hq/element-web#24228.
* Fix: Poll replies overflow when not enough space ([\matrix-org#9924](matrix-org#9924)). Fixes element-hq/element-web#24227. Contributed by @kerryarchibald.
* State event updates are not forwarded to the widget from invitation room ([\matrix-org#9802](matrix-org#9802)). Contributed by @maheichyk.
* Fix error when viewing source of redacted events ([\matrix-org#9914](matrix-org#9914)). Fixes element-hq/element-web#24165. Contributed by @clarkf.
* Replace outdated css attribute ([\matrix-org#9912](matrix-org#9912)). Fixes element-hq/element-web#24218. Contributed by @justjanne.
* Clear isLogin theme override when user is no longer viewing login screens ([\matrix-org#9911](matrix-org#9911)). Fixes element-hq/element-web#23893.
* Fix reply action in message context menu notif & file panels ([\matrix-org#9895](matrix-org#9895)). Fixes element-hq/element-web#23970.
* Fix issue where thread dropdown would not show up correctly ([\matrix-org#9872](matrix-org#9872)). Fixes element-hq/element-web#24040. Contributed by @justjanne.
* Fix unexpected composer growing ([\matrix-org#9889](matrix-org#9889)). Contributed by @florianduros.
* Fix misaligned timestamps for thread roots which are emotes ([\matrix-org#9875](matrix-org#9875)). Fixes element-hq/element-web#23897. Contributed by @justjanne.
  • Loading branch information
su-ex committed Feb 1, 2023
2 parents a1e6fe4 + 1f3ad86 commit 0f9478f
Show file tree
Hide file tree
Showing 781 changed files with 8,419 additions and 6,467 deletions.
8 changes: 6 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,12 @@ module.exports = {
files: ["src/**/*.{ts,tsx}", "test/**/*.{ts,tsx}", "cypress/**/*.ts"],
extends: ["plugin:matrix-org/typescript", "plugin:matrix-org/react"],
rules: {
// temporary disabled
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-function-return-type": [
"error",
{
allowExpressions: true,
},
],

// Things we do that break the ideal style
"prefer-promise-reject-errors": "off",
Expand Down
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
Changes in [3.65.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.65.0) (2023-01-31)
=====================================================================================================

## ✨ Features
* Quotes for rte ([\#9932](https://github.com/matrix-org/matrix-react-sdk/pull/9932)). Contributed by @alunturner.
* Show the room name in the room header during calls ([\#9942](https://github.com/matrix-org/matrix-react-sdk/pull/9942)). Fixes vector-im/element-web#24268.
* Add code blocks to rich text editor ([\#9921](https://github.com/matrix-org/matrix-react-sdk/pull/9921)). Contributed by @alunturner.
* Add new style for inline code ([\#9936](https://github.com/matrix-org/matrix-react-sdk/pull/9936)). Contributed by @florianduros.
* Add disabled button state to rich text editor ([\#9930](https://github.com/matrix-org/matrix-react-sdk/pull/9930)). Contributed by @alunturner.
* Change the rageshake "app" for auto-rageshakes ([\#9909](https://github.com/matrix-org/matrix-react-sdk/pull/9909)).
* Device manager - tweak settings display ([\#9905](https://github.com/matrix-org/matrix-react-sdk/pull/9905)). Contributed by @kerryarchibald.
* Add list functionality to rich text editor ([\#9871](https://github.com/matrix-org/matrix-react-sdk/pull/9871)). Contributed by @alunturner.

## 🐛 Bug Fixes
* Fix RTE focus behaviour in threads ([\#9969](https://github.com/matrix-org/matrix-react-sdk/pull/9969)). Fixes vector-im/element-web#23755. Contributed by @florianduros.
* #22204 Issue: Centered File info in lightbox ([\#9971](https://github.com/matrix-org/matrix-react-sdk/pull/9971)). Fixes vector-im/element-web#22204. Contributed by @Spartan09.
* Fix seekbar position for zero length audio ([\#9949](https://github.com/matrix-org/matrix-react-sdk/pull/9949)). Fixes vector-im/element-web#24248.
* Allow thread panel to be closed after being opened from notification ([\#9937](https://github.com/matrix-org/matrix-react-sdk/pull/9937)). Fixes vector-im/element-web#23764 vector-im/element-web#23852 and vector-im/element-web#24213. Contributed by @justjanne.
* Only highlight focused menu item if focus is supposed to be visible ([\#9945](https://github.com/matrix-org/matrix-react-sdk/pull/9945)). Fixes vector-im/element-web#23582.
* Prevent call durations from breaking onto multiple lines ([\#9944](https://github.com/matrix-org/matrix-react-sdk/pull/9944)).
* Tweak call lobby buttons to more closely match designs ([\#9943](https://github.com/matrix-org/matrix-react-sdk/pull/9943)).
* Do not show a broadcast as live immediately after the recording has stopped ([\#9947](https://github.com/matrix-org/matrix-react-sdk/pull/9947)). Fixes vector-im/element-web#24233.
* Clear the RTE before sending a message ([\#9948](https://github.com/matrix-org/matrix-react-sdk/pull/9948)). Contributed by @florianduros.
* Fix {enter} press in RTE ([\#9927](https://github.com/matrix-org/matrix-react-sdk/pull/9927)). Contributed by @florianduros.
* Fix the problem that the password reset email has to be confirmed twice ([\#9926](https://github.com/matrix-org/matrix-react-sdk/pull/9926)). Fixes vector-im/element-web#24226.
* replace .at() with array.length-1 ([\#9933](https://github.com/matrix-org/matrix-react-sdk/pull/9933)). Fixes matrix-org/element-web-rageshakes#19281.
* Fix broken threads list timestamp layout ([\#9922](https://github.com/matrix-org/matrix-react-sdk/pull/9922)). Fixes vector-im/element-web#24243 and vector-im/element-web#24191. Contributed by @justjanne.
* Disable multiple messages when {enter} is pressed multiple times ([\#9929](https://github.com/matrix-org/matrix-react-sdk/pull/9929)). Fixes vector-im/element-web#24249. Contributed by @florianduros.
* Fix logout devices when resetting the password ([\#9925](https://github.com/matrix-org/matrix-react-sdk/pull/9925)). Fixes vector-im/element-web#24228.
* Fix: Poll replies overflow when not enough space ([\#9924](https://github.com/matrix-org/matrix-react-sdk/pull/9924)). Fixes vector-im/element-web#24227. Contributed by @kerryarchibald.
* State event updates are not forwarded to the widget from invitation room ([\#9802](https://github.com/matrix-org/matrix-react-sdk/pull/9802)). Contributed by @maheichyk.
* Fix error when viewing source of redacted events ([\#9914](https://github.com/matrix-org/matrix-react-sdk/pull/9914)). Fixes vector-im/element-web#24165. Contributed by @clarkf.
* Replace outdated css attribute ([\#9912](https://github.com/matrix-org/matrix-react-sdk/pull/9912)). Fixes vector-im/element-web#24218. Contributed by @justjanne.
* Clear isLogin theme override when user is no longer viewing login screens ([\#9911](https://github.com/matrix-org/matrix-react-sdk/pull/9911)). Fixes vector-im/element-web#23893.
* Fix reply action in message context menu notif & file panels ([\#9895](https://github.com/matrix-org/matrix-react-sdk/pull/9895)). Fixes vector-im/element-web#23970.
* Fix issue where thread dropdown would not show up correctly ([\#9872](https://github.com/matrix-org/matrix-react-sdk/pull/9872)). Fixes vector-im/element-web#24040. Contributed by @justjanne.
* Fix unexpected composer growing ([\#9889](https://github.com/matrix-org/matrix-react-sdk/pull/9889)). Contributed by @florianduros.
* Fix misaligned timestamps for thread roots which are emotes ([\#9875](https://github.com/matrix-org/matrix-react-sdk/pull/9875)). Fixes vector-im/element-web#23897. Contributed by @justjanne.

Changes in [3.64.2](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.64.2) (2023-01-20)
=====================================================================================================

Expand Down
5 changes: 2 additions & 3 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ export default defineConfig({
return require("./cypress/plugins/index.ts").default(on, config);
},
baseUrl: "http://localhost:8080",
experimentalSessionAndOrigin: true,
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}",
},
env: {
// Docker tag to use for `ghcr.io/matrix-org/sliding-sync-proxy` image.
SLIDING_SYNC_PROXY_TAG: "v0.6.0",
// Docker tag to use for `ghcr.io/matrix-org/sliding-sync` image.
SLIDING_SYNC_PROXY_TAG: "v0.99.0-rc1",
HOMESERVER: "synapse",
},
retries: {
Expand Down
22 changes: 18 additions & 4 deletions cypress/e2e/composer/composer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,27 @@ describe("Composer", () => {

// Type another
cy.get("div[contenteditable=true]").type("my message 1");
// Press enter. Would be nice to just use {enter} but we can't because Cypress
// does not trigger an insertParagraph when you do that.
cy.get("div[contenteditable=true]").trigger("input", { inputType: "insertParagraph" });
// Send message
cy.get("div[contenteditable=true]").type("{enter}");
// It was sent
cy.contains(".mx_EventTile_body", "my message 1");
});

it("sends only one message when you press Enter multiple times", () => {
// Type a message
cy.get("div[contenteditable=true]").type("my message 0");
// It has not been sent yet
cy.contains(".mx_EventTile_body", "my message 0").should("not.exist");

// Click send
cy.get("div[contenteditable=true]").type("{enter}");
cy.get("div[contenteditable=true]").type("{enter}");
cy.get("div[contenteditable=true]").type("{enter}");
// It has been sent
cy.contains(".mx_EventTile_body", "my message 0");
cy.get(".mx_EventTile_body").should("have.length", 1);
});

it("can write formatted text", () => {
cy.get("div[contenteditable=true]").type("my {ctrl+b}bold{ctrl+b} message");
cy.get('div[aria-label="Send message"]').click();
Expand All @@ -141,7 +155,7 @@ describe("Composer", () => {
it("only sends when you press Ctrl+Enter", () => {
// Type a message and press Enter
cy.get("div[contenteditable=true]").type("my message 3");
cy.get("div[contenteditable=true]").trigger("input", { inputType: "insertParagraph" });
cy.get("div[contenteditable=true]").type("{enter}");
// It has not been sent yet
cy.contains(".mx_EventTile_body", "my message 3").should("not.exist");

Expand Down
13 changes: 9 additions & 4 deletions cypress/e2e/crypto/crypto.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type { ISasEvent } from "matrix-js-sdk/src/crypto/verification/SAS";
import type { CypressBot } from "../../support/bot";
import { HomeserverInstance } from "../../plugins/utils/homeserver";
import Chainable = Cypress.Chainable;
import { UserCredentials } from "../../support/login";

type EmojiMapping = [emoji: string, name: string];
interface CryptoTestContext extends Mocha.Context {
Expand Down Expand Up @@ -154,11 +155,15 @@ const verify = function (this: CryptoTestContext) {
};

describe("Cryptography", function () {
let aliceCredentials: UserCredentials;

beforeEach(function () {
cy.startHomeserver("default")
.as("homeserver")
.then((homeserver: HomeserverInstance) => {
cy.initTestUser(homeserver, "Alice", undefined, "alice_");
cy.initTestUser(homeserver, "Alice", undefined, "alice_").then((credentials) => {
aliceCredentials = credentials;
});
cy.getBot(homeserver, { displayName: "Bob", autoAcceptInvites: false, userIdPrefix: "bob_" }).as("bob");
});
});
Expand All @@ -183,7 +188,7 @@ describe("Cryptography", function () {
});

it("creating a DM should work, being e2e-encrypted / user verification", function (this: CryptoTestContext) {
cy.bootstrapCrossSigning();
cy.bootstrapCrossSigning(aliceCredentials);
startDMWithBob.call(this);
// send first message
cy.get(".mx_BasicMessageComposer_input").click().should("have.focus").type("Hey!{enter}");
Expand All @@ -194,7 +199,7 @@ describe("Cryptography", function () {
});

it("should allow verification when there is no existing DM", function (this: CryptoTestContext) {
cy.bootstrapCrossSigning();
cy.bootstrapCrossSigning(aliceCredentials);
autoJoin(this.bob);

// we need to have a room with the other user present, so we can open the verification panel
Expand All @@ -212,7 +217,7 @@ describe("Cryptography", function () {
});

it("should show the correct shield on edited e2e events", function (this: CryptoTestContext) {
cy.bootstrapCrossSigning();
cy.bootstrapCrossSigning(aliceCredentials);

// bob has a second, not cross-signed, device
cy.loginBot(this.homeserver, this.bob.getUserId(), this.bob.__cypress_password, {}).as("bobSecondDevice");
Expand Down
22 changes: 6 additions & 16 deletions cypress/e2e/crypto/decryption-failure.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,9 @@ describe("Decryption Failure Bar", () => {
"and there are other verified devices or backups",
() => {
let otherDevice: MatrixClient | undefined;
cy.loginBot(homeserver, testUser.username, testUser.password, {})
cy.loginBot(homeserver, testUser.username, testUser.password, { bootstrapCrossSigning: true })
.then(async (cli) => {
otherDevice = cli;
await otherDevice.bootstrapCrossSigning({
authUploadDeviceSigningKeys: async (makeRequest) => {
await makeRequest({});
},
setupNewCrossSigning: true,
});
})
.then(() => {
cy.botSendMessage(bot, roomId, "test");
Expand Down Expand Up @@ -169,15 +163,11 @@ describe("Decryption Failure Bar", () => {
"should prompt the user to reset keys, if this device isn't verified " +
"and there are no other verified devices or backups",
() => {
cy.loginBot(homeserver, testUser.username, testUser.password, {}).then(async (cli) => {
await cli.bootstrapCrossSigning({
authUploadDeviceSigningKeys: async (makeRequest) => {
await makeRequest({});
},
setupNewCrossSigning: true,
});
await cli.logout(true);
});
cy.loginBot(homeserver, testUser.username, testUser.password, { bootstrapCrossSigning: true }).then(
async (cli) => {
await cli.logout(true);
},
);

cy.botSendMessage(bot, roomId, "test");
cy.wait(5000);
Expand Down
90 changes: 87 additions & 3 deletions cypress/e2e/editing/editing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ limitations under the License.

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

import type { MsgType } from "matrix-js-sdk/src/@types/event";
import type { EventType, MsgType } from "matrix-js-sdk/src/@types/event";
import type { ISendEventResponse } from "matrix-js-sdk/src/@types/requests";
import type { EventType } from "matrix-js-sdk/src/@types/event";
import type { IContent } from "matrix-js-sdk/src/models/event";
import { HomeserverInstance } from "../../plugins/utils/homeserver";
import Chainable = Cypress.Chainable;

Expand All @@ -29,6 +29,16 @@ const sendEvent = (roomId: string): Chainable<ISendEventResponse> => {
});
};

/** generate a message event which will take up some room on the page. */
function mkPadding(n: number): IContent {
return {
msgtype: "m.text" as MsgType,
body: `padding ${n}`,
format: "org.matrix.custom.html",
formatted_body: `<h3>Test event ${n}</h3>\n`.repeat(10),
};
}

describe("Editing", () => {
let homeserver: HomeserverInstance;

Expand All @@ -37,7 +47,6 @@ describe("Editing", () => {
homeserver = data;
cy.initTestUser(homeserver, "Edith").then(() => {
cy.injectAxe();
return cy.createRoom({ name: "Test room" }).as("roomId");
});
});
});
Expand All @@ -47,6 +56,8 @@ describe("Editing", () => {
});

it("should close the composer when clicking save after making a change and undoing it", () => {
cy.createRoom({ name: "Test room" }).as("roomId");

cy.get<string>("@roomId").then((roomId) => {
sendEvent(roomId);
cy.visit("/#/room/" + roomId);
Expand All @@ -64,4 +75,77 @@ describe("Editing", () => {
// Assert that the edit composer has gone away
cy.get(".mx_EditMessageComposer").should("not.exist");
});

it("should correctly display events which are edited, where we lack the edit event", () => {
// This tests the behaviour when a message has been edited some time after it has been sent, and we
// jump back in room history to view the event, but do not have the actual edit event.
//
// In that scenario, we rely on the server to replace the content (pre-MSC3925), or do it ourselves based on
// the bundled edit event (post-MSC3925).
//
// To test it, we need to have a room with lots of events in, so we can jump around the timeline without
// paginating in the event itself. Hence, we create a bot user which creates the room and populates it before
// we join.

let testRoomId: string;
let originalEventId: string;
let editEventId: string;

// create a second user
const bobChainable = cy.getBot(homeserver, { displayName: "Bob", userIdPrefix: "bob_" });

cy.all([cy.window({ log: false }), bobChainable]).then(async ([win, bob]) => {
// "bob" now creates the room, and sends a load of events in it. Note that all of this happens via calls on
// the js-sdk rather than Cypress commands, so uses regular async/await.

const room = await bob.createRoom({ name: "TestRoom", visibility: win.matrixcs.Visibility.Public });
testRoomId = room.room_id;
cy.log(`Bot user created room ${room.room_id}`);

originalEventId = (await bob.sendMessage(room.room_id, { body: "original", msgtype: "m.text" })).event_id;
cy.log(`Bot user sent original event ${originalEventId}`);

// send a load of padding events. We make them large, so that they fill the whole screen
// and the client doesn't end up paginating into the event we want.
let i = 0;
while (i < 10) {
await bob.sendMessage(room.room_id, mkPadding(i++));
}

// ... then the edit ...
editEventId = (
await bob.sendMessage(room.room_id, {
"m.new_content": { body: "Edited body", msgtype: "m.text" },
"m.relates_to": {
rel_type: "m.replace",
event_id: originalEventId,
},
"body": "* edited",
"msgtype": "m.text",
})
).event_id;
cy.log(`Bot user sent edit event ${editEventId}`);

// ... then a load more padding ...
while (i < 20) {
await bob.sendMessage(room.room_id, mkPadding(i++));
}
});

cy.getClient().then((cli) => {
// now have the cypress user join the room, jump to the original event, and wait for the event to be
// visible
cy.joinRoom(testRoomId);
cy.viewRoomByName("TestRoom");
cy.visit(`#/room/${testRoomId}/${originalEventId}`);
cy.get(`[data-event-id="${originalEventId}"]`).should((messageTile) => {
// at this point, the edit event should still be unknown
expect(cli.getRoom(testRoomId).getTimelineForEvent(editEventId)).to.be.null;

// nevertheless, the event should be updated
expect(messageTile.find(".mx_EventTile_body").text()).to.eq("Edited body");
expect(messageTile.find(".mx_EventTile_edited")).to.exist;
});
});
});
});
22 changes: 20 additions & 2 deletions cypress/e2e/integration-manager/kick.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,27 @@ function sendActionFromIntegrationManager(integrationManagerUrl: string, targetR
});
}

function clickUntilGone(selector: string, attempt = 0) {
if (attempt === 11) {
throw new Error("clickUntilGone attempt count exceeded");
}

cy.get(selector)
.last()
.click()
.then(($button) => {
const exists = Cypress.$(selector).length > 0;
if (exists) {
clickUntilGone(selector, ++attempt);
}
});
}

function expectKickedMessage(shouldExist: boolean) {
// Expand any event summaries
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=false]").click({ multiple: true });
// Expand any event summaries, we can't use a click multiple here because clicking one might de-render others
// This is quite horrible but seems the most stable way of clicking 0-N buttons,
// one at a time with a full re-evaluation after each click
clickUntilGone(".mx_GenericEventListSummary_toggle[aria-expanded=false]");

// Check for the event message (or lack thereof)
cy.contains(".mx_EventTile_line", `${USER_DISPLAY_NAME} removed ${BOT_DISPLAY_NAME}: ${KICK_REASON}`).should(
Expand Down
Loading

0 comments on commit 0f9478f

Please sign in to comment.