Change device isolation mode to set `errorOnVerifiedUserProblems` to `false` (#104)

https://github.com/element-hq/matrix-react-sdk/pull/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.
pull/28192/head
Richard van der Hoff 2024-09-30 21:33:23 +01:00 committed by GitHub
parent 33c900e307
commit 36fae00cf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 6 deletions

View File

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

View File

@ -27,7 +27,7 @@ describe("DeviceIsolationModeController", () => {
const cli = stubClient();
const controller = new DeviceIsolationModeController();
controller.onChange(SettingLevel.DEVICE, "", false);
expect(cli.getCrypto()?.setDeviceIsolationMode).toHaveBeenCalledWith(new AllDevicesIsolationMode(true));
expect(cli.getCrypto()?.setDeviceIsolationMode).toHaveBeenCalledWith(new AllDevicesIsolationMode(false));
});
});
});