From d06b28d70f408804485977f022328807a0b0856f Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Thu, 8 Aug 2024 15:29:47 -0400 Subject: [PATCH 1/2] 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. --- src/matrixrtc/MatrixRTCSession.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/matrixrtc/MatrixRTCSession.ts b/src/matrixrtc/MatrixRTCSession.ts index a317495a95d..d93920efa35 100644 --- a/src/matrixrtc/MatrixRTCSession.ts +++ b/src/matrixrtc/MatrixRTCSession.ts @@ -772,6 +772,14 @@ export class MatrixRTCSession extends TypedEventEmitter => { + // TODO: Should this await on a shared promise? if (this.updateCallMembershipRunning) { this.needCallMembershipUpdate = true; return; @@ -1030,7 +1039,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, From d69b075d3fd32221b22b291a65e774ba0bf7c98e Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Thu, 17 Oct 2024 16:10:57 -0400 Subject: [PATCH 2/2] Don't emit state changed on join recovery --- src/matrixrtc/MatrixRTCSession.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/matrixrtc/MatrixRTCSession.ts b/src/matrixrtc/MatrixRTCSession.ts index d93920efa35..b8274fdbaa0 100644 --- a/src/matrixrtc/MatrixRTCSession.ts +++ b/src/matrixrtc/MatrixRTCSession.ts @@ -777,8 +777,6 @@ export class MatrixRTCSession extends TypedEventEmitter