Share the mapping from parameters to call view model options

The SDK stopped sending join notifications: it threaded callIntent into
createCallViewModel$ but not its pair sendNotificationType, which
enterRTCSession used to read for itself, so an explicit
?sendNotificationType=ring — or an intent that implies one — no longer
reached joinRTCSession.

The mechanism is worth fixing rather than the instance. The defaults on
CallViewModelOptions describe a standalone Element Call, so a widget
caller that misses a field gets standalone behaviour rather than an error,
and the SDK is only ever a widget. Give both callers one shared mapping so
they cannot drift, and cover the whole chain from URL to options in tests.

autoLeaveWhenOthersLeft and waitForCallPickup stay out of it: the view
model never read those from the parameters, so enabling them for the SDK
would be a change in its behaviour rather than a fix.
This commit is contained in:
Valere
2026-09-02 19:26:33 +02:00
parent 182be8676d
commit 6b5f396e1e
4 changed files with 87 additions and 24 deletions
+4 -16
View File
@@ -41,6 +41,7 @@ import { type MatrixInfo } from "./VideoPreview";
import { InviteButton } from "../button/InviteButton";
import {
type CallViewModel,
callViewModelOptionsFromParams,
createCallViewModel$,
} from "../state/CallViewModel/CallViewModel.ts";
import { Grid, type TileProps } from "../grid/Grid";
@@ -123,16 +124,8 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
rootLogger.info("START CALL VIEW SCOPE");
const scope = new ObservableScope();
const reactionsReader = new ReactionsReader(scope, props.rtcSession);
const {
autoLeaveWhenOthersLeft,
waitForCallPickup,
sendNotificationType,
controlledAudioDevices,
header,
showControls,
hideScreensharing,
callIntent,
} = urlParams;
const { autoLeaveWhenOthersLeft, waitForCallPickup, sendNotificationType } =
urlParams;
const vm = createCallViewModel$(
scope,
@@ -141,17 +134,12 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
mediaDevices,
props.muteStates,
{
...callViewModelOptionsFromParams(urlParams),
encryptionSystem: props.e2eeSystem,
hostBridge,
autoLeaveWhenOthersLeft,
waitForCallPickup: waitForCallPickup && sendNotificationType === "ring",
matrixRTCMode$: matrixRTCModeSetting.value$,
controlledAudioDevices,
header,
showControls,
hideScreensharing,
sendNotificationType,
callIntent,
},
reactionsReader.raisedHands$,
reactionsReader.reactions$,