element-hq / element-hq/element-call

js-sdk voip architecture: MatrixRTCSessionManager

Open
#1,432 3 comments 0 reactions 0 assignees View on GitHub
T-Task
Dominant language
TypeScript
Stars
996
Forks
213
Avg merge
1d 6h
Merged PRs (30d)
54

Description

### Your use case

https://github.com/matrix-org/matrix-js-sdk/pull/3663 introduces the MatrixRTCSessionManager. Daniel asks: does this class need to exist or could it be split between Room and MatrixcRTCSession?

Full comment:

> I'm not confident that we really need the rtc session manager at this point, I'd rather invested more on the rtc session itself. IMHO currently it's fairly complicated (for the amount of code that it contains it has a high accidental complexity) and feels somewhat brittle (my gut feeling is that there will be bugs and edge-cases with the changes introduced in the PR and the solutions for them won't be particularly elegant - e.g. the solution for the async/await function looks quite complicated atm and hard to understand and it's generally not a very idiomatic way of solving state access/synchronisation problems). I also think that the API surface of the matrix RTC session could resemble LiveKit's Room a bit more (conceptually it's the same thing and it would also help unifying/merging them once we work on a deeper integration to introduce cascading). I'm particularly picky on such topics because I think that the matrix RTC session is a foundation upon which the rest of the things are going to be built in the future. That being said, if the changes are considered temporary and we don't plan to build much stuff on top of that, it might be fine to leave it like this.

We'd like to revisit this architecture later and see if the design could be better without this class (eg. maybe when we introduce support for user sessions or when implementing MatrixRTC in the rust SDK.

### Have you considered any alternatives?

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reviewing PR 3663 and the MatrixRTCSessionManager, Room, and MatrixRTCSession designs mentioned in the issue. Compare the session API with LiveKit's Room concept and consider implications for user sessions and the Rust SDK. Done means an agreed architectural direction, but the issue provides no concrete acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
audio-video-rtc
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.