Skip to content
Open
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
1 change: 0 additions & 1 deletion .github/workflows/static_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ jobs:
allowed-hardcoded-keys: |
console_dev_note
labs|element_call_video_rooms
labs|feature_disable_call_per_sender_encryption
voip|element_call
error|invalid_json
error|misconfigured
Expand Down
9 changes: 0 additions & 9 deletions docs/labs.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,6 @@ This feature allows users to place native [MSC3401](https://github.com/matrix-or

If you're enabling this at the deployment level, you may also want to reference the docs for the `element_call` config section.

## Disable per-sender encryption for Element Call (`feature_disable_call_per_sender_encryption`)

The default for embedded Element Call in Element Web is per-participant encryption.
This labs flag disables encryption for embedded Element Call in encrypted rooms.

Under the hood this stops Element Web from adding the `perParticipantE2EE` flag for the Element Call widget url.

This is useful while we experiment with encryption and to make calling compatible with platforms that don't use encryption yet.

## Enable the notifications panel in the room header (`feature_notifications`)

Unreliable in encrypted rooms.
Expand Down
1 change: 0 additions & 1 deletion playwright/e2e/voip/element-call.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
expect(url.has("widgetId")).toEqual(true);
expect(url.has("parentUrl")).toEqual(true);

expect(hash.get("perParticipantE2EE")).toEqual("false");
expect(hash.get("userId")).toEqual(user.userId);
expect(hash.get("deviceId")).toEqual(user.deviceId);
expect(hash.get("roomId")).toEqual(room.roomId);
Expand Down Expand Up @@ -656,7 +655,7 @@

const messageSent = await page.getByText("I sent this once!!").count();

expect(messageSent).toBe(1);

Check failure on line 658 in playwright/e2e/voip/element-call.spec.ts

View workflow job for this annotation

GitHub Actions / Run Tests [Chrome] 6/6

[Chrome] › playwright/e2e/voip/element-call.spec.ts:633:13 › Element Call › Widget leak bug reproduction › Switching rooms should not leak widgets @no-firefox @no-webkit

1) [Chrome] › playwright/e2e/voip/element-call.spec.ts:633:13 › Element Call › Widget leak bug reproduction › Switching rooms should not leak widgets @no-firefox @no-webkit Error: expect(received).toBe(expected) // Object.is equality Expected: 1 Received: 0 656 | const messageSent = await page.getByText("I sent this once!!").count(); 657 | > 658 | expect(messageSent).toBe(1); | ^ 659 | }); 660 | }); 661 | }); at /home/runner/work/element-web/element-web/playwright/e2e/voip/element-call.spec.ts:658:33
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const CallGuestLinkButton: React.FC<{ room: Room }> = ({ room }) => {
url.pathname = "/room/";
// Set params for the sharable url
url.searchParams.set("roomId", room.roomId);
if (room.hasEncryptionStateEvent()) url.searchParams.set("perParticipantE2EE", "true");
for (const server of calculateRoomVia(room)) {
url.searchParams.set("viaServers", server);
}
Expand Down
1 change: 0 additions & 1 deletion src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,6 @@
"experimental_description": "Feeling experimental? Try out our latest ideas in development. These features are not finalised; they may be unstable, may change, or may be dropped altogether. <a>Learn more</a>.",
"experimental_section": "Early previews",
"extended_profiles_msc_support": "Requires your server to support MSC4133",
"feature_disable_call_per_sender_encryption": "Disable per-sender encryption for Element Call",
"feature_wysiwyg_composer_description": "Use rich text instead of Markdown in the message composer.",
"group_calls": "New group call experience",
"group_developer": "Developer",
Expand Down
18 changes: 0 additions & 18 deletions src/models/Call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,6 @@ export class ElementCall extends Call {
// Parameters can be found in https://github.com/element-hq/element-call/blob/livekit/src/UrlParams.ts.
const params = new URLSearchParams({
// Template variables are used, so that this can be configured using the widget data.
perParticipantE2EE: "$perParticipantE2EE",
userId: client.getUserId()!,
deviceId: client.getDeviceId()!,
roomId: roomId,
Expand Down Expand Up @@ -873,27 +872,15 @@ export class ElementCall extends Call {
overwriteData: IWidgetData,
voiceOnly?: boolean,
): IWidgetData {
let perParticipantE2EE = false;
if (
client.getRoom(roomId)?.hasEncryptionStateEvent() &&
!SettingsStore.getValue("feature_disable_call_per_sender_encryption")
)
perParticipantE2EE = true;

const intent = ElementCall.getWidgetIntent(client, roomId, voiceOnly);

return {
...currentData,
...overwriteData,
intent,
perParticipantE2EE,
};
}

private onCallEncryptionSettingsChange(): void {
this.widget.data = ElementCall.getWidgetData(this.client, this.roomId, this.widget.data ?? {}, {});
}

private constructor(
public session: MatrixRTCSession,
widget: IApp,
Expand All @@ -903,11 +890,6 @@ export class ElementCall extends Call {

this.session.on(MatrixRTCSessionEvent.MembershipsChanged, this.onMembershipChanged);
this.client.matrixRTC.on(MatrixRTCSessionManagerEvents.SessionEnded, this.checkDestroy);
SettingsStore.watchSetting(
"feature_disable_call_per_sender_encryption",
null,
this.onCallEncryptionSettingsChange.bind(this),
);
this.updateParticipants();
}

Expand Down
9 changes: 0 additions & 9 deletions src/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ export interface Settings {
"feature_simplified_sliding_sync": IFeature;
"feature_element_call_video_rooms": IFeature;
"feature_group_calls": IFeature;
"feature_disable_call_per_sender_encryption": IFeature;
"feature_location_share_live": IFeature;
"feature_dynamic_room_predecessors": IFeature;
"feature_render_reaction_images": IFeature;
Expand Down Expand Up @@ -644,14 +643,6 @@ export const SETTINGS: Settings = {
controller: new ReloadOnChangeController(),
default: false,
},
"feature_disable_call_per_sender_encryption": {
isFeature: true,
labsGroup: LabGroup.VoiceAndVideo,
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG_PRIORITISED,
supportedLevelsAreOrdered: true,
displayName: _td("labs|feature_disable_call_per_sender_encryption"),
default: false,
},
"feature_location_share_live": {
isFeature: true,
labsGroup: LabGroup.Messaging,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("<CallGuestLinkButton />", () => {
const targetUnencrypted =
"https://guest_spa_url.com/room/#/!room:server.org?roomId=%21room%3Aserver.org&viaServers=example.org";
const targetEncrypted =
"https://guest_spa_url.com/room/#/!room:server.org?roomId=%21room%3Aserver.org&perParticipantE2EE=true&viaServers=example.org";
"https://guest_spa_url.com/room/#/!room:server.org?roomId=%21room%3Aserver.org&viaServers=example.org";
const expectedShareDialogProps = {
target: targetEncrypted,
customTitle: "Conference invite link",
Expand Down Expand Up @@ -183,8 +183,6 @@ describe("<CallGuestLinkButton />", () => {
getComponent(room);
const modalSpy = jest.spyOn(Modal, "createDialog");
fireEvent.click(getByLabelText(document.body, _t("voip|get_call_link")));
// const target =
// "https://guest_spa_url.com/room/#/!room:server.org?roomId=%21room%3Aserver.org&perParticipantE2EE=true&viaServers=example.org";
expect(modalSpy).toHaveBeenCalled();
const arg0 = modalSpy.mock.calls[0][0];
const arg1 = modalSpy.mock.calls[0][1] as any;
Expand Down
24 changes: 1 addition & 23 deletions test/unit-tests/models/Call-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ import {
ElementCall,
ElementCallIntent,
} from "../../../src/models/Call";
import { cleanUpClientRoomAndStores, enableCalls, mockPlatformPeg, setUpClientRoomAndStores } from "../../test-utils";
import WidgetStore from "../../../src/stores/WidgetStore";
import { cleanUpClientRoomAndStores, mockPlatformPeg, setUpClientRoomAndStores } from "../../test-utils";
import { WidgetMessagingStore } from "../../../src/stores/widgets/WidgetMessagingStore";
import ActiveWidgetStore, { ActiveWidgetStoreEvent } from "../../../src/stores/ActiveWidgetStore";
import { ElementWidgetActions } from "../../../src/stores/widgets/ElementWidgetActions";
Expand All @@ -50,8 +49,6 @@ import SdkConfig from "../../../src/SdkConfig.ts";
import DMRoomMap from "../../../src/utils/DMRoomMap.ts";
import { WidgetMessagingEvent, type WidgetMessaging } from "../../../src/stores/widgets/WidgetMessaging.ts";

const { enabledSettings } = enableCalls();

const setUpWidget = (
call: Call,
): { widget: Widget; messaging: Mocked<WidgetMessaging>; widgetApi: Mocked<ClientWidgetApi> } => {
Expand Down Expand Up @@ -983,25 +980,6 @@ describe("ElementCall", () => {
call.destroy();
expect(destroyPersistentWidgetSpy).toHaveBeenCalled();
});

it("the perParticipantE2EE url flag is used in encrypted rooms while respecting the feature_disable_call_per_sender_encryption flag", async () => {
// We destroy the call created in beforeEach because we test the call creation process.
call.destroy();
const addWidgetSpy = jest.spyOn(WidgetStore.instance, "addVirtualWidget");
// If a room is not encrypted we will never add the perParticipantE2EE flag.
const roomSpy = jest.spyOn(room, "hasEncryptionStateEvent").mockReturnValue(true);

// should create call with perParticipantE2EE flag
ElementCall.create(room);
expect(Call.get(room)?.widget?.data?.perParticipantE2EE).toBe(true);

// should create call without perParticipantE2EE flag
enabledSettings.add("feature_disable_call_per_sender_encryption");
expect(Call.get(room)?.widget?.data?.perParticipantE2EE).toBe(false);
enabledSettings.delete("feature_disable_call_per_sender_encryption");
roomSpy.mockRestore();
addWidgetSpy.mockRestore();
});
});

describe("instance in a video room", () => {
Expand Down
Loading