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

Make the js-sdk compatible with MSC preferred foci and active focus. #4195

Merged
merged 22 commits into from
Jun 17, 2024

Conversation

toger5
Copy link
Contributor

@toger5 toger5 commented May 8, 2024

The call.member events are refactored in a backwards compatible way to not only have one array: foci_active: Focus[] but instead one array:
foci_preferred: Focus[]
and a single:
focus_active: Focus

Foci active should just be one field describing what you are currently using. In a fully cascading world this is your own foci. In the livekit scenario this describes how you connect to the correct livekit session. (using the oldest session member should be the default, but if someone is using sth else everyone should connect to the other livekit session as well. Not yet implemented)

foci_preferred is what foci_active has been. The list of possible foci this user knows about or can use.

fixes element-hq/element-call#1737

Signed-off-by: Timo K [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).

Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm a bit lost here. This looks like way more than a refactor, this looks like a fundamental format change and trying to be backwards comapt. The description seems to suggest the only change is adding foci_preferred?

src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSessionManager.ts Show resolved Hide resolved
Copy link
Member

@AndrewFerr AndrewFerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review

src/@types/event.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/LivekitFocus.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Show resolved Hide resolved
Copy link
Member

@AndrewFerr AndrewFerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some optional requests, but this looks good overall!

src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Show resolved Hide resolved
Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a typo in the PR description where you've said foci_active [] where you mean focus_active? This makes it quite a confusing read. ;)

Other than that, I think it looks plausible, although having all this to support both systems at once is heart rending. This might be more an MSC comment but what's the reason for needing to change foci_active to focus_active rather than leave it as an array?

@dbkr
Copy link
Member

dbkr commented Jun 10, 2024

oh, also - I still vote to fix the title: 'refactor' to me means, "cleaner code with same functionality" which this isn't. In fact, documenting the reasons for changing in general would be a good thing.

@toger5 toger5 changed the title Refactor to preferred and active foci. Make the js-sdk compatible with preferred foci and active focus. Jun 10, 2024
@toger5 toger5 changed the title Make the js-sdk compatible with preferred foci and active focus. Make js-sdk compatible with MSC4143: new matrix_rtc membership format Jun 10, 2024
@toger5
Copy link
Contributor Author

toger5 commented Jun 10, 2024

@dbkr I updated the description and the title. Thanks.

focus_active rather than leave it as an array

An array forces us to specify how to deal with active elements of different types. This is either very complicated and/or has to be done on a per focus type bases. (It is not clear what use-cases this will have an how it will be used/ how we define how to interpret an array of active_foci. It could be to transition between infrastructure types or to have redundancy. In both cases all participants need to sync and map streams in both systems -> we need to expose this somehow outside the infrastructure itself... This all becomes more complicated than what we want matrixRTC to be.)
If there really is a use-case there will be specific custom active focus types that allow lists of foci and contain the necessary information how they are meant to be used. This also guarantees that everybody in the meeting is compatible with this custom focus type and knows how to deal with multiple active foci.)

support both systems at once is heart rending

in this case it was easy enough and we are able to merge this into the js sdk without making breaking everything.
We basically want to make the transition less stressful for us so we dont have to get it working in a couple of days now since it is broken.

This way we can merge this and work on the reliable memberships with one aspect less to worry about since the js sdk will work with both formats.

@toger5 toger5 changed the title Make js-sdk compatible with MSC4143: new matrix_rtc membership format Make the js-sdk compatible with MSC preferred foci and active focus. Jun 10, 2024
@toger5 toger5 requested a review from dbkr June 11, 2024 09:49
Copy link

@fkwp fkwp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@toger5 toger5 added this pull request to the merge queue Jun 17, 2024
Merged via the queue into develop with commit d754392 Jun 17, 2024
27 checks passed
@toger5 toger5 deleted the toger5/preferred-active-foci branch June 17, 2024 13:25
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.

Add foci_preferred to m.call.member event
4 participants