Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roll back change to device isolation mode #104

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/settings/controllers/DeviceIsolationModeController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
});
});
Loading