From c7b0f9783de382dc40b65e61915f7233ebeba744 Mon Sep 17 00:00:00 2001 From: Timo <16718859+toger5@users.noreply.github.com> Date: Wed, 30 Jul 2025 14:58:45 +0200 Subject: [PATCH] expose `delayed_leave_event_restart_local_timeout_ms` to `config.json` (#3415) --- src/config/ConfigOptions.ts | 11 +++++++++++ src/rtcSessionHelpers.ts | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/config/ConfigOptions.ts b/src/config/ConfigOptions.ts index c4dc9144..75bd7cbb 100644 --- a/src/config/ConfigOptions.ts +++ b/src/config/ConfigOptions.ts @@ -125,6 +125,17 @@ export interface ConfigOptions { /** @deprecated use delayed_leave_event_delay_ms instead */ membership_server_side_expiry_timeout?: number; + /** + * The time (in milliseconds) after which a we consider a delayed event restart http request to have failed. + * Setting this to a lower value will result in more frequent retries but also a higher chance of failiour. + * + * In the presence of network packet loss (hurting TCP connections), the custom delayedEventRestartLocalTimeoutMs + * helps by keeping more delayed event reset candidates in flight, + * improving the chances of a successful reset. (its is equivalent to the js-sdk `localTimeout` configuration, + * but only applies to calls to the `_unstable_updateDelayedEvent` endpoint with a body of `{action:"restart"}`.) + */ + delayed_leave_event_restart_local_timeout_ms?: number; + /** * The time interval (in milliseconds) at which the client sends membership keep-alive * messages to the server by restarting the timer for the delayed leave event. diff --git a/src/rtcSessionHelpers.ts b/src/rtcSessionHelpers.ts index 3ff6b560..a193b8e5 100644 --- a/src/rtcSessionHelpers.ts +++ b/src/rtcSessionHelpers.ts @@ -128,6 +128,8 @@ export async function enterRTCSession( delayedLeaveEventDelayMs: matrixRtcSessionConfig?.delayed_leave_event_delay_ms ?? matrixRtcSessionConfig?.membership_server_side_expiry_timeout, + delayedLeaveEventRestartLocalTimeoutMs: + matrixRtcSessionConfig?.delayed_leave_event_restart_local_timeout_ms, networkErrorRetryMs: matrixRtcSessionConfig?.network_error_retry_ms, makeKeyDelay: matrixRtcSessionConfig?.wait_for_key_rotation_ms ??