Compare commits

...

6 Commits

Author SHA1 Message Date
Robin
d81c8b0186 Merge pull request #3056 from element-hq/robin/backport-join-action
Backport "Send a 'join' action when entering the call" to v0.7
2025-03-05 12:48:15 -05:00
Robin
800a1dae8b Merge pull request #3057 from element-hq/robin/backport-return-to-lobby
Backport "Avoid closing the widget in returnToLobby mode" to v0.7
2025-03-05 12:47:19 -05:00
Robin
8225956338 Backport "Avoid closing the widget in returnToLobby mode" to v0.7
This is a manual backport of 28c45c6107 which makes the video room behavior consistent across the v0.7.2 patch release and development versions.
2025-03-05 12:30:07 -05:00
Robin
e72c05ed41 Send a 'join' action when entering the call
Following a75952cf77, 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 (e9a3625bd6/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.)
2025-03-05 12:21:55 -05:00
Robin
ac9e7d297b Merge pull request #3046 from element-hq/robin/close-action-patch
Patch for v0.7: Send a 'close' action when the widget is ready to close
2025-03-04 11:11:06 -05:00
Robin
05c079e3ed Patch for v0.7: Send a 'close' action when the widget is ready to close
This is a watered-down version of the changes in 832a5aaf57 which should be suitable as a patch to the v0.7 release series. It makes Element Call widgets send a 'close' action in addition to the original 'hangup' action, and nothing more.

The point is that we can then deploy this change to call.element.io with little effort so that clients are more immediately free to expect a 'close' action from Element Call (and thus we unblock https://github.com/element-hq/element-call/issues/2955 and https://github.com/element-hq/element-web/issues/29196).
2025-03-04 00:29:37 -05:00
2 changed files with 26 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ import {
import { PosthogAnalytics } from "./analytics/PosthogAnalytics";
import { Config } from "./config/Config";
import { ElementWidgetActions, WidgetHelpers, widget } from "./widget";
import { getUrlParams } from "./UrlParams";
const FOCI_WK_KEY = "org.matrix.msc4143.rtc_foci";
@@ -116,6 +117,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 (
@@ -135,7 +143,22 @@ const widgetPostHangupProcedure = async (
// We send the hangup event after the memberships have been updated
// calling leaveRTCSession.
// We need to wait because this makes the client hosting this widget killing the IFrame.
await widget.api.transport.send(ElementWidgetActions.HangupCall, {});
try {
await widget.api.transport.send(ElementWidgetActions.HangupCall, {});
} catch (e) {
logger.error("Failed to send hangup action", e);
}
// To make the hangup procedure behave more similarly to what future versions
// of Element Call will do, we additionally send a close action (even though
// we're not yet employing the distinction between 'hangup' and 'close' to
// display error screens)
if (!getUrlParams().returnToLobby) {
try {
await widget.api.transport.send(ElementWidgetActions.Close, {});
} catch (e) {
logger.error("Failed to send close action", e);
}
}
};
export async function leaveRTCSession(

View File

@@ -17,10 +17,11 @@ import { getUrlParams } from "./UrlParams";
import { Config } from "./config/Config";
import { ElementCallReactionEventType } from "./reactions";
// Subset of the actions in matrix-react-sdk
// Subset of the actions in element-web
export enum ElementWidgetActions {
JoinCall = "io.element.join",
HangupCall = "im.vector.hangup",
Close = "io.element.close",
TileLayout = "io.element.tile_layout",
SpotlightLayout = "io.element.spotlight_layout",
// This can be sent as from or to widget