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

Commit 3cafeb7

Browse files
committed
Change device isolation mode to set errorOnVerifiedUserProblems to false
#92 changed the default mode for encryption to throw an error when sending a message and the room contains either: - a verified user with an unverified device - a verifeid user who has changed their identity. We're not really ready for this (we lack the UI to deal with it), so roll that back.
1 parent bd793a0 commit 3cafeb7

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/settings/controllers/DeviceIsolationModeController.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ export default class DeviceIsolationModeController extends SettingController {
2929
* @param settingValue - value of the "exclude_insecure_devices" setting.
3030
*/
3131
export function setDeviceIsolationMode(client: MatrixClient, settingValue: boolean): void {
32-
client
33-
.getCrypto()
34-
?.setDeviceIsolationMode(
35-
settingValue ? new OnlySignedDevicesIsolationMode() : new AllDevicesIsolationMode(true),
36-
);
32+
client.getCrypto()?.setDeviceIsolationMode(
33+
settingValue
34+
? new OnlySignedDevicesIsolationMode()
35+
: // TODO: As part of https://github.com/element-hq/element-meta/issues/2492, we will change
36+
// `errorOnVerifiedUserProblems` to `true`, but we need to have better UI in place before we can do so.
37+
new AllDevicesIsolationMode(false),
38+
);
3739
}

test/settings/controllers/DeviceIsolationModeController-test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe("DeviceIsolationModeController", () => {
2727
const cli = stubClient();
2828
const controller = new DeviceIsolationModeController();
2929
controller.onChange(SettingLevel.DEVICE, "", false);
30-
expect(cli.getCrypto()?.setDeviceIsolationMode).toHaveBeenCalledWith(new AllDevicesIsolationMode(true));
30+
expect(cli.getCrypto()?.setDeviceIsolationMode).toHaveBeenCalledWith(new AllDevicesIsolationMode(false));
3131
});
3232
});
3333
});

0 commit comments

Comments
 (0)