Skip to content

Commit

Permalink
Trigger call rejoin attempt only if you were in it
Browse files Browse the repository at this point in the history
Many membership events may get synced while your own join attempt is
being processed, during which you will not be in the call membership
list.  So, only try to rejoin if it seems that you have _left_ the call,
not when you are not (yet) in the call.
  • Loading branch information
AndrewFerr committed Nov 12, 2024
1 parent 705b633 commit 8321695
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/matrixrtc/MatrixRTCSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,11 @@ export class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSessionEvent, M
logger.info(`Memberships for call in room ${this.room.roomId} have changed: emitting`);
this.emit(MatrixRTCSessionEvent.MembershipsChanged, oldMemberships, this.memberships);

if (this.isJoined() && !this.memberships.some(this.isMyMembership)) {
if (
this.isJoined() &&
oldMemberships.some(this.isMyMembership) &&
!this.memberships.some(this.isMyMembership)
) {
logger.warn("Missing own membership: force re-join");
// TODO: Should this be awaited? And is there anything to tell the focus?
this.triggerCallMembershipEventUpdate();
Expand Down

0 comments on commit 8321695

Please sign in to comment.