From 6855ace6422082d173438cb23368d2fabc6a1086 Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Mon, 11 Nov 2024 10:07:33 -0500 Subject: [PATCH] When state says you've left ongoing call, rejoin (#4342) * When state says you've left ongoing call, rejoin When receiving a state change that says you are no longer a member of a RTC session that you are actually still participating in, send another state event to put yourself back in the session membership. This can happen when an administrator overwrites your call membership event (which is allowed even with MSC3757's restrictions on state), or if your delayed disconnection event (via MSC4140) timed out before your client could send a heartbeat to delay it further. * Don't emit state changed on join recovery --- src/matrixrtc/MatrixRTCSession.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/matrixrtc/MatrixRTCSession.ts b/src/matrixrtc/MatrixRTCSession.ts index a317495a95..b8274fdbaa 100644 --- a/src/matrixrtc/MatrixRTCSession.ts +++ b/src/matrixrtc/MatrixRTCSession.ts @@ -772,6 +772,12 @@ export class MatrixRTCSession extends TypedEventEmitter => { + // TODO: Should this await on a shared promise? if (this.updateCallMembershipRunning) { this.needCallMembershipUpdate = true; return; @@ -1030,7 +1037,6 @@ export class MatrixRTCSession extends TypedEventEmitter => { try { - // TODO: If delayed event times out, re-join! const res = await resendIfRateLimited(() => this.client._unstable_sendDelayedStateEvent( this.room.roomId,