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

Commit a7bc0e4

Browse files
committed
Merge branch 'master' into develop
2 parents 73cc598 + 25e67be commit a7bc0e4

File tree

8 files changed

+241
-17
lines changed

8 files changed

+241
-17
lines changed

CHANGELOG.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,96 @@
1+
Changes in [3.105.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.105.1) (2024-08-06)
2+
=======================================================================================================
3+
Fixes for CVE-2024-42347 / GHSA-f83w-wqhc-cfp4
4+
5+
Changes in [3.105.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.105.0) (2024-08-06)
6+
=======================================================================================================
7+
Fixes for CVE-2024-42347 / GHSA-f83w-wqhc-cfp4
8+
9+
Changes in [3.104.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.104.0) (2024-07-30)
10+
=======================================================================================================
11+
## ✨ Features
12+
13+
* Add release announcement for the new room header ([#12802](https://github.com/matrix-org/matrix-react-sdk/pull/12802)). Contributed by @MidhunSureshR.
14+
* Default the room header to on ([#12803](https://github.com/matrix-org/matrix-react-sdk/pull/12803)). Contributed by @MidhunSureshR.
15+
* Update Thread Panel to match latest designs ([#12797](https://github.com/matrix-org/matrix-react-sdk/pull/12797)). Contributed by @t3chguy.
16+
* Close any open modals on logout ([#12777](https://github.com/matrix-org/matrix-react-sdk/pull/12777)). Contributed by @dbkr.
17+
* Iterate design of right panel empty state ([#12796](https://github.com/matrix-org/matrix-react-sdk/pull/12796)). Contributed by @t3chguy.
18+
* Update styling of UserInfo right panel card ([#12788](https://github.com/matrix-org/matrix-react-sdk/pull/12788)). Contributed by @t3chguy.
19+
* Accessibility: Add Landmark navigation ([#12190](https://github.com/matrix-org/matrix-react-sdk/pull/12190)). Contributed by @akirk.
20+
* Let Element Call widget receive m.room.create ([#12710](https://github.com/matrix-org/matrix-react-sdk/pull/12710)). Contributed by @AndrewFerr.
21+
* Let Element Call widget set session memberships ([#12713](https://github.com/matrix-org/matrix-react-sdk/pull/12713)). Contributed by @AndrewFerr.
22+
* Update right panel base card styling to match Compound ([#12768](https://github.com/matrix-org/matrix-react-sdk/pull/12768)). Contributed by @t3chguy.
23+
* Align `widget_build_url_ignore_dm` with call behaviour switch between 1:1 and Widget ([#12760](https://github.com/matrix-org/matrix-react-sdk/pull/12760)). Contributed by @t3chguy.
24+
* Move integrations switch ([#12733](https://github.com/matrix-org/matrix-react-sdk/pull/12733)). Contributed by @dbkr.
25+
* Element-R: Report events with withheld keys separately to Posthog. ([#12755](https://github.com/matrix-org/matrix-react-sdk/pull/12755)). Contributed by @richvdh.
26+
27+
## 🐛 Bug Fixes
28+
29+
* Test for lack of WebAssembly support ([#12792](https://github.com/matrix-org/matrix-react-sdk/pull/12792)). Contributed by @dbkr.
30+
* Fix stray 'account' heading ([#12791](https://github.com/matrix-org/matrix-react-sdk/pull/12791)). Contributed by @dbkr.
31+
* Add test for the unsupported browser screen ([#12787](https://github.com/matrix-org/matrix-react-sdk/pull/12787)). Contributed by @dbkr.
32+
* Fix HTML export test ([#12778](https://github.com/matrix-org/matrix-react-sdk/pull/12778)). Contributed by @dbkr.
33+
* Fix HTML export missing a bunch of Compound variables ([#12774](https://github.com/matrix-org/matrix-react-sdk/pull/12774)). Contributed by @t3chguy.
34+
* Fix inability to change accent colour consistently in custom theming ([#12772](https://github.com/matrix-org/matrix-react-sdk/pull/12772)). Contributed by @t3chguy.
35+
* Fix edge case of landing on 3pid email link with registration disabled ([#12771](https://github.com/matrix-org/matrix-react-sdk/pull/12771)). Contributed by @t3chguy.
36+
37+
38+
Changes in [3.103.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.103.0) (2024-07-16)
39+
=======================================================================================================
40+
## ✨ Features
41+
42+
* Add tabs to the right panel ([#12672](https://github.com/matrix-org/matrix-react-sdk/pull/12672)). Contributed by @MidhunSureshR.
43+
* Promote new room header from labs to Beta ([#12739](https://github.com/matrix-org/matrix-react-sdk/pull/12739)). Contributed by @t3chguy.
44+
* Redesign room search interface ([#12677](https://github.com/matrix-org/matrix-react-sdk/pull/12677)). Contributed by @t3chguy.
45+
* Move language settings to 'preferences' ([#12723](https://github.com/matrix-org/matrix-react-sdk/pull/12723)). Contributed by @dbkr.
46+
* New layout selector ui in user settings ([#12676](https://github.com/matrix-org/matrix-react-sdk/pull/12676)). Contributed by @florianduros.
47+
* Prevent Element appearing in system media controls ([#10995](https://github.com/matrix-org/matrix-react-sdk/pull/10995)). Contributed by @SuperKenVery.
48+
* Move the account management button ([#12663](https://github.com/matrix-org/matrix-react-sdk/pull/12663)). Contributed by @dbkr.
49+
* Disable profile controls if the HS doesn't allow them to be set ([#12652](https://github.com/matrix-org/matrix-react-sdk/pull/12652)). Contributed by @dbkr.
50+
* New theme ui in user settings ([#12576](https://github.com/matrix-org/matrix-react-sdk/pull/12576)). Contributed by @florianduros.
51+
* Adjust room header hover transition from 300ms to 200ms ([#12703](https://github.com/matrix-org/matrix-react-sdk/pull/12703)). Contributed by @t3chguy.
52+
* Split out email \& phone number settings to separate components \& move discovery to privacy tab ([#12670](https://github.com/matrix-org/matrix-react-sdk/pull/12670)). Contributed by @dbkr.
53+
54+
## 🐛 Bug Fixes
55+
56+
* Fix incoming call toast crash due to audio refactor ([#12737](https://github.com/matrix-org/matrix-react-sdk/pull/12737)). Contributed by @t3chguy.
57+
* Improve new room header accessibility ([#12725](https://github.com/matrix-org/matrix-react-sdk/pull/12725)). Contributed by @t3chguy.
58+
* Fix closing all modals ([#12728](https://github.com/matrix-org/matrix-react-sdk/pull/12728)). Contributed by @dbkr.
59+
* Fix close button on forgot password flow ([#12732](https://github.com/matrix-org/matrix-react-sdk/pull/12732)). Contributed by @dbkr.
60+
* Don't consider textual characters to be emoji ([#12582](https://github.com/matrix-org/matrix-react-sdk/pull/12582)). Contributed by @robintown.
61+
* Clear autocomplete input on selection accept ([#12709](https://github.com/matrix-org/matrix-react-sdk/pull/12709)). Contributed by @dbkr.
62+
* Fix `Match system theme` toggle ([#12719](https://github.com/matrix-org/matrix-react-sdk/pull/12719)). Contributed by @florianduros.
63+
64+
65+
Changes in [3.102.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.102.0) (2024-07-08)
66+
=======================================================================================================
67+
## ✨ Features
68+
69+
* Switch to Rust crypto stack for all logins ([#12630](https://github.com/matrix-org/matrix-react-sdk/pull/12630)). Contributed by @richvdh.
70+
* Hide voip buttons in group rooms in environments with widgets disabled ([#12664](https://github.com/matrix-org/matrix-react-sdk/pull/12664)). Contributed by @t3chguy.
71+
* Minor tweaks to UserSettings dialog ([#12651](https://github.com/matrix-org/matrix-react-sdk/pull/12651)). Contributed by @florianduros.
72+
* Hide voice call button when redundant ([#12639](https://github.com/matrix-org/matrix-react-sdk/pull/12639)). Contributed by @t3chguy.
73+
* Improve accessibility of the room summary card ([#12586](https://github.com/matrix-org/matrix-react-sdk/pull/12586)). Contributed by @t3chguy.
74+
* Show tooltips on narrow tabbed views ([#12624](https://github.com/matrix-org/matrix-react-sdk/pull/12624)). Contributed by @dbkr.
75+
* Update gfm.css to github-markdown-css ([#12613](https://github.com/matrix-org/matrix-react-sdk/pull/12613)). Contributed by @t3chguy.
76+
* Cache e2eStatus to avoid concerning unencrypted flicker when changing rooms ([#12606](https://github.com/matrix-org/matrix-react-sdk/pull/12606)). Contributed by @t3chguy.
77+
* Tweak copy for user verification toast ([#12605](https://github.com/matrix-org/matrix-react-sdk/pull/12605)). Contributed by @t3chguy.
78+
* Support s tags for strikethrough for Matrix v1.10 ([#12604](https://github.com/matrix-org/matrix-react-sdk/pull/12604)). Contributed by @t3chguy.
79+
80+
## 🐛 Bug Fixes
81+
82+
* Remove redundant copy in deactive uia modal ([#12668](https://github.com/matrix-org/matrix-react-sdk/pull/12668)). Contributed by @t3chguy.
83+
* Fix high contrast theme in settings ([#12649](https://github.com/matrix-org/matrix-react-sdk/pull/12649)). Contributed by @florianduros.
84+
* Fix background on live location sharing footer ([#12629](https://github.com/matrix-org/matrix-react-sdk/pull/12629)). Contributed by @t3chguy.
85+
* Remove outdated iframe sandbox attribute ([#12633](https://github.com/matrix-org/matrix-react-sdk/pull/12633)). Contributed by @t3chguy.
86+
* Remove stray setState which caused encryption state shields to flicker ([#12632](https://github.com/matrix-org/matrix-react-sdk/pull/12632)). Contributed by @t3chguy.
87+
* Fix stray background colour on markdown body ([#12628](https://github.com/matrix-org/matrix-react-sdk/pull/12628)). Contributed by @t3chguy.
88+
* Fix widgets not being cleaned up correctly. ([#12616](https://github.com/matrix-org/matrix-react-sdk/pull/12616)). Contributed by @toger5.
89+
* Add in-progress view to display name EditInPlace ([#12609](https://github.com/matrix-org/matrix-react-sdk/pull/12609)). Contributed by @dbkr.
90+
* Fix config override of other settings levels ([#12593](https://github.com/matrix-org/matrix-react-sdk/pull/12593)). Contributed by @langleyd.
91+
* Don't show 'saved' on display name save error ([#12600](https://github.com/matrix-org/matrix-react-sdk/pull/12600)). Contributed by @dbkr.
92+
93+
194
Changes in [3.101.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.101.0) (2024-06-18)
295
=======================================================================================================
396
## ✨ Features

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "matrix-react-sdk",
3-
"version": "3.101.0",
3+
"version": "3.105.1",
44
"description": "SDK for matrix.org using React",
55
"author": "matrix.org",
66
"repository": {
@@ -26,7 +26,7 @@
2626
"engines": {
2727
"node": ">=20.0.0"
2828
},
29-
"main": "./src/index.ts",
29+
"main": "./lib/index.ts",
3030
"matrix_src_main": "./src/index.ts",
3131
"matrix_lib_main": "./lib/index.ts",
3232
"matrix_lib_typings": "./lib/index.d.ts",
@@ -118,7 +118,7 @@
118118
"maplibre-gl": "^2.0.0",
119119
"matrix-encrypt-attachment": "^1.0.3",
120120
"matrix-events-sdk": "0.0.1",
121-
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
121+
"matrix-js-sdk": "34.2.0",
122122
"matrix-widget-api": "^1.5.0",
123123
"memoize-one": "^6.0.0",
124124
"minimist": "^1.2.5",
@@ -250,5 +250,6 @@
250250
"outputDirectory": "coverage",
251251
"outputName": "jest-sonar-report.xml",
252252
"relativePaths": true
253-
}
253+
},
254+
"typings": "./lib/index.d.ts"
254255
}

src/Lifecycle.ts

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ dis.register((payload) => {
102102
// If we unset the client and the component is updated, the render will fail and unmount everything.
103103
// (The module dialog closes and fires a `aria_unhide_main_app` that will trigger a re-render)
104104
stopMatrixClient(false);
105-
doSetLoggedIn(typed.credentials, true).catch((e) => {
105+
doSetLoggedIn(typed.credentials, true, true).catch((e) => {
106106
// XXX we might want to fire a new event here to let the app know that the login failed ?
107107
// The module api could use it to display a message to the user.
108108
logger.warn("Failed to overwrite login", e);
@@ -208,6 +208,7 @@ export async function loadSession(opts: ILoadSessionOpts = {}): Promise<boolean>
208208
guest: true,
209209
},
210210
true,
211+
false,
211212
).then(() => true);
212213
}
213214
const success = await restoreFromLocalStorage({
@@ -465,6 +466,7 @@ function registerAsGuest(hsUrl: string, isUrl?: string, defaultDeviceDisplayName
465466
guest: true,
466467
},
467468
true,
469+
true,
468470
).then(() => true);
469471
},
470472
(err) => {
@@ -610,6 +612,7 @@ export async function restoreFromLocalStorage(opts?: { ignoreGuest?: boolean }):
610612
freshLogin: freshLogin,
611613
},
612614
false,
615+
false,
613616
);
614617
return true;
615618
} else {
@@ -663,7 +666,7 @@ export async function setLoggedIn(credentials: IMatrixClientCreds): Promise<Matr
663666
logger.log("Pickle key not created");
664667
}
665668

666-
return doSetLoggedIn(Object.assign({}, credentials, { pickleKey }), true);
669+
return doSetLoggedIn(Object.assign({}, credentials, { pickleKey }), true, true);
667670
}
668671

669672
/**
@@ -700,7 +703,7 @@ export async function hydrateSession(credentials: IMatrixClientCreds): Promise<M
700703
(await PlatformPeg.get()?.getPickleKey(credentials.userId, credentials.deviceId)) ?? undefined;
701704
}
702705

703-
return doSetLoggedIn(credentials, overwrite);
706+
return doSetLoggedIn(credentials, overwrite, false);
704707
}
705708

706709
/**
@@ -746,12 +749,17 @@ async function createOidcTokenRefresher(credentials: IMatrixClientCreds): Promis
746749
* optionally clears localstorage, persists new credentials
747750
* to localstorage, starts the new client.
748751
*
749-
* @param {IMatrixClientCreds} credentials
750-
* @param {Boolean} clearStorageEnabled
752+
* @param {IMatrixClientCreds} credentials The credentials to use
753+
* @param {Boolean} clearStorageEnabled True to clear storage before starting the new client
754+
* @param {Boolean} isFreshLogin True if this is a fresh login, false if it is previous session being restored
751755
*
752756
* @returns {Promise} promise which resolves to the new MatrixClient once it has been started
753757
*/
754-
async function doSetLoggedIn(credentials: IMatrixClientCreds, clearStorageEnabled: boolean): Promise<MatrixClient> {
758+
async function doSetLoggedIn(
759+
credentials: IMatrixClientCreds,
760+
clearStorageEnabled: boolean,
761+
isFreshLogin: boolean,
762+
): Promise<MatrixClient> {
755763
checkSessionLock();
756764
credentials.guest = Boolean(credentials.guest);
757765

@@ -840,6 +848,9 @@ async function doSetLoggedIn(credentials: IMatrixClientCreds, clearStorageEnable
840848
clientPegOpts.rustCryptoStoreKey?.fill(0);
841849
}
842850

851+
// Run the migrations after the MatrixClientPeg has been assigned
852+
SettingsStore.runMigrations(isFreshLogin);
853+
843854
return client;
844855
}
845856

@@ -1021,9 +1032,6 @@ async function startMatrixClient(
10211032

10221033
checkSessionLock();
10231034

1024-
// Run the migrations after the MatrixClientPeg has been assigned
1025-
SettingsStore.runMigrations();
1026-
10271035
// This needs to be started after crypto is set up
10281036
DeviceListener.sharedInstance().start(client);
10291037
// Similarly, don't start sending presence updates until we've started
@@ -1165,5 +1173,6 @@ window.mxLoginWithAccessToken = async (hsUrl: string, accessToken: string): Prom
11651173
userId,
11661174
},
11671175
true,
1176+
false,
11681177
);
11691178
};

src/components/views/room_settings/UrlPreviewSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default class UrlPreviewSettings extends React.Component<IProps> {
101101
(
102102
<SettingsFlag
103103
name={isEncrypted ? "urlPreviewsEnabled_e2ee" : "urlPreviewsEnabled"}
104-
level={SettingLevel.ROOM_ACCOUNT}
104+
level={SettingLevel.ROOM_DEVICE}
105105
roomId={roomId}
106106
/>
107107
);

src/settings/Settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ export const SETTINGS: { [setting: string]: ISetting } = {
900900
controller: new UIFeatureController(UIFeature.URLPreviews),
901901
},
902902
"urlPreviewsEnabled_e2ee": {
903-
supportedLevels: [SettingLevel.ROOM_DEVICE, SettingLevel.ROOM_ACCOUNT],
903+
supportedLevels: [SettingLevel.ROOM_DEVICE],
904904
displayName: {
905905
"room-account": _td("settings|inline_url_previews_room_account"),
906906
},

src/settings/SettingsStore.ts

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717

1818
import { logger } from "matrix-js-sdk/src/logger";
1919
import { ReactNode } from "react";
20+
import { ClientEvent, SyncState } from "matrix-js-sdk/src/matrix";
2021

2122
import DeviceSettingsHandler from "./handlers/DeviceSettingsHandler";
2223
import RoomDeviceSettingsHandler from "./handlers/RoomDeviceSettingsHandler";
@@ -36,6 +37,7 @@ import { SettingUpdatedPayload } from "../dispatcher/payloads/SettingUpdatedPayl
3637
import { Action } from "../dispatcher/actions";
3738
import PlatformSettingsHandler from "./handlers/PlatformSettingsHandler";
3839
import ReloadOnChangeController from "./controllers/ReloadOnChangeController";
40+
import { MatrixClientPeg } from "../MatrixClientPeg";
3941

4042
// Convert the settings to easier to manage objects for the handlers
4143
const defaultSettings: Record<string, any> = {};
@@ -637,10 +639,61 @@ export default class SettingsStore {
637639
return null;
638640
}
639641

642+
/**
643+
* Migrate the setting for URL previews in e2e rooms from room account
644+
* data to the room device level.
645+
*
646+
* @param isFreshLogin True if the user has just logged in, false if a previous session is being restored.
647+
*/
648+
private static async migrateURLPreviewsE2EE(isFreshLogin: boolean): Promise<void> {
649+
const MIGRATION_DONE_FLAG = "url_previews_e2ee_migration_done";
650+
if (localStorage.getItem(MIGRATION_DONE_FLAG)) return;
651+
if (isFreshLogin) return;
652+
653+
const client = MatrixClientPeg.safeGet();
654+
655+
const doMigration = async (): Promise<void> => {
656+
logger.info("Performing one-time settings migration of URL previews in E2EE rooms");
657+
658+
const roomAccounthandler = LEVEL_HANDLERS[SettingLevel.ROOM_ACCOUNT];
659+
660+
for (const room of client.getRooms()) {
661+
// We need to use the handler directly because this setting is no longer supported
662+
// at this level at all
663+
const val = roomAccounthandler.getValue("urlPreviewsEnabled_e2ee", room.roomId);
664+
665+
if (val !== undefined) {
666+
await SettingsStore.setValue("urlPreviewsEnabled_e2ee", room.roomId, SettingLevel.ROOM_DEVICE, val);
667+
}
668+
}
669+
670+
localStorage.setItem(MIGRATION_DONE_FLAG, "true");
671+
};
672+
673+
const onSync = (state: SyncState): void => {
674+
if (state === SyncState.Prepared) {
675+
client.removeListener(ClientEvent.Sync, onSync);
676+
677+
doMigration().catch((e) => {
678+
logger.error("Failed to migrate URL previews in E2EE rooms:", e);
679+
});
680+
}
681+
};
682+
683+
client.on(ClientEvent.Sync, onSync);
684+
}
685+
640686
/**
641687
* Runs or queues any setting migrations needed.
642688
*/
643-
public static runMigrations(): void {
689+
public static runMigrations(isFreshLogin: boolean): void {
690+
// This can be removed once enough users have run a version of Element with
691+
// this migration. A couple of months after its release should be sufficient
692+
// (so around October 2024).
693+
// The consequences of missing the migration are only that URL previews will
694+
// be disabled in E2EE rooms.
695+
SettingsStore.migrateURLPreviewsE2EE(isFreshLogin);
696+
644697
// Dev notes: to add your migration, just add a new `migrateMyFeature` function, call it, and
645698
// add a comment to note when it can be removed.
646699
return;

0 commit comments

Comments
 (0)