From 5b1ea4501d379324427401af94a0cc0f8ecb183e Mon Sep 17 00:00:00 2001 From: Robin Date: Wed, 5 Mar 2025 09:25:52 -0500 Subject: [PATCH] Send a 'join' action when entering the call Following a75952cf77cea0fc67058defb43850d7ff153163, this is one more upgrade to the widget communication that I'd like to make within this release cycle. The motivating issue is https://github.com/element-hq/element-web/issues/29429. Fundamentally, without a 'join' action, the only info Element Web can use to determine whether it's joined the call is whether a MatrixRTC membership exists. But membership state events can inaccurately represent the client's actual state (whether because delayed events aren't supported, or because the delayed event hasn't timed out yet), so I suggest we send a 'join' action here just as we do in the Element Web Jitsi wrapper (https://github.com/element-hq/element-web/blob/e9a3625bd6e9a64f216e3caeabca66f48b649332/src/vector/jitsi/index.ts#L503) to let Element Web tap directly into the widget's local state. (This will need additional Element Web changes, but is certainly backwards compatible.) --- src/rtcSessionHelpers.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rtcSessionHelpers.ts b/src/rtcSessionHelpers.ts index 719af998..9fb4d3af 100644 --- a/src/rtcSessionHelpers.ts +++ b/src/rtcSessionHelpers.ts @@ -124,6 +124,13 @@ export async function enterRTCSession( makeKeyDelay: matrixRtcSessionConfig?.key_rotation_on_leave_delay, }, ); + if (widget) { + try { + await widget.api.transport.send(ElementWidgetActions.JoinCall, {}); + } catch (e) { + logger.error("Failed to send join action", e); + } + } } const widgetPostHangupProcedure = async (