Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When state says you've left ongoing call, rejoin #4342

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

AndrewFerr
Copy link
Member

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.

Signed-off-by: Andrew Ferrazzutti [email protected]

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • Sign-off given on the changes (see CONTRIBUTING.md).

@AndrewFerr AndrewFerr marked this pull request as draft October 17, 2024 20:16
@AndrewFerr
Copy link
Member Author

Marking as draft until test coverage is added.

Local testing is also hitting some strange behaviour.

@AndrewFerr
Copy link
Member Author

This doesn't yet fully work in widget mode + Element Web (and potentially other clients). EW terminates the widget when it detects that there are no members left in a call. So, if there's only one person left in a call and their membership is lost (such as by a missed heartbeat), EW will close the widget before EC has a chance to restore the membership.

A naive solution could be to make EW simply wait a few seconds for an "empty" session to become non-empty. Ideally it could examine Livekit state (if that's even possible).

But EW does need to know when a call is empty, because AFAICT that's how it clears the entry in the room preview bar.

@AndrewFerr
Copy link
Member Author

I've made this depend on #4494 because without it, attempts to restore membership state are likely to get rate-limited.

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.
@AndrewFerr
Copy link
Member Author

Albeit not fully working for embedded mode, this is still a step in the right direction IMO.

@AndrewFerr AndrewFerr added this pull request to the merge queue Nov 11, 2024
Merged via the queue into develop with commit 6855ace Nov 11, 2024
26 checks passed
@AndrewFerr AndrewFerr deleted the af/rtc-send-rejoin-state branch November 11, 2024 15:25
hughns added a commit to element-hq/element-call that referenced this pull request Nov 11, 2024
hughns added a commit to element-hq/element-call that referenced this pull request Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants