Compare commits

...

5 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

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 (
@@ -144,10 +152,12 @@ const widgetPostHangupProcedure = async (
// 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)
try {
await widget.api.transport.send(ElementWidgetActions.Close, {});
} catch (e) {
logger.error("Failed to send close action", e);
if (!getUrlParams().returnToLobby) {
try {
await widget.api.transport.send(ElementWidgetActions.Close, {});
} catch (e) {
logger.error("Failed to send close action", e);
}
}
};