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

Remove support for "legacy" MSC3898 group calling in MatrixRTCSession and CallMembership #4583

Merged
merged 13 commits into from
Jan 6, 2025

Conversation

toger5
Copy link
Contributor

@toger5 toger5 commented Dec 12, 2024

MSC3898 has been superseded by MSC4143.

This PR removes support for MSC3898 and allows us to cleanup this area of the codebase significantly. We want to do this ahead of some further refactoring to make it more maintainable.

Breaking changes:

  • Call membership that are not in MSC4143 format will be ignored
  • The unused ExperimentalGroupCallRoomMemberState type is removed
  • The deprecated CallMembership.getLocalExpiry() function is removed

Background:

It is time to get rid of the legacy call format. (Legacy = one call event for all memberships per user. Now we have one event for each. So: Legacy: state_key = userId, non-legacy/session events: state_key=_userid_deviceId The transition has been made and deployed everywhere. No deployed client is using this system without being compatible with the new system.

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).

@toger5 toger5 requested a review from a team as a code owner December 12, 2024 14:58
@toger5 toger5 requested a review from hughns December 12, 2024 14:58
@toger5 toger5 added the T-Deprecation A pull request that makes something deprecated label Dec 12, 2024
@toger5 toger5 changed the title remove all legacy call related code and adjust tests. Remove all legacy call related code and adjust tests. Dec 12, 2024
@toger5 toger5 marked this pull request as draft December 12, 2024 16:53
@toger5 toger5 force-pushed the toger5/refactor-matrixrtcsession-part1-legacy branch 2 times, most recently from 3c04d2b to bcef1d3 Compare December 12, 2024 16:55
@toger5 toger5 force-pushed the toger5/refactor-matrixrtcsession-part1-legacy branch 2 times, most recently from 042862b to 4418747 Compare December 12, 2024 18:38
We actually had a bit of tests just for legacy and not for session events. All those tests got ported over so we do not remove any tests.
@toger5 toger5 force-pushed the toger5/refactor-matrixrtcsession-part1-legacy branch from b900f7a to c0e5909 Compare December 12, 2024 18:53
@toger5 toger5 marked this pull request as ready for review December 12, 2024 18:57
@toger5 toger5 requested a review from a team as a code owner December 12, 2024 18:57
@toger5 toger5 requested review from dbkr and MidhunSureshR December 12, 2024 18:57
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.

This is quite a sizeable PR and not a very obvious change either. I might need some help understanding what's going on here.

CHANGELOG.md Outdated Show resolved Hide resolved
spec/unit/matrixrtc/CallMembership.spec.ts Outdated Show resolved Hide resolved
src/matrixrtc/MatrixRTCSession.ts Outdated Show resolved Hide resolved
Copy link
Member

@hughns hughns left a comment

Choose a reason for hiding this comment

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

I'm finding it hard to reason about changes to the tests because the legacy behaviour is removed vs cleaning up the tests.

@toger5 would it be a lot of work to split this into two PRs? one with just the legacy removals and the other refactoring the test cases?

@hughns hughns changed the title Remove all legacy call related code and adjust tests. Remove legacy MatrixRTC related code and adjust tests Dec 16, 2024
@toger5 toger5 force-pushed the toger5/refactor-matrixrtcsession-part1-legacy branch from c0e5909 to 05915fb Compare December 16, 2024 16:09
@toger5 toger5 changed the title Remove legacy MatrixRTC related code and adjust tests Remove legacy MatrixRTC related code and remove realted tests Dec 16, 2024
@toger5 toger5 force-pushed the toger5/refactor-matrixrtcsession-part1-legacy branch from dd8726e to 795a3cf Compare December 16, 2024 19:04
@toger5
Copy link
Contributor Author

toger5 commented Dec 16, 2024

@toger5 would it be a lot of work to split this into two PRs? one with just the legacy removals and the other refactoring the test cases?

it is fine to move it into a seperate PR: #4587

It will be very tedious to maintain the two branches. So as soon as we notice this needs more changes I propose just closing this PR and using it to make reviewing easier and merge the other (4587) branch.

@toger5 toger5 force-pushed the toger5/refactor-matrixrtcsession-part1-legacy branch from 795a3cf to e8588e8 Compare December 16, 2024 19:21
@toger5
Copy link
Contributor Author

toger5 commented Dec 17, 2024

@dbkr We made this an "almost" exclusively remove code PR.
This mostly adds docstrings.
So this is ready for another round of reviews.

Copy link
Member

@hughns hughns left a comment

Choose a reason for hiding this comment

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

From a VoIP team point of view this looks great. 👍

I defer to web team folk for final review.

src/matrixrtc/MatrixRTCSession.ts Outdated 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.

Looks generally sensible now, thanks for slimming this down.

spec/unit/matrixrtc/MatrixRTCSession.spec.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Outdated Show resolved Hide resolved
src/matrixrtc/CallMembership.ts Show resolved Hide resolved
Comment on lines 164 to 167
// Assume that local clock is sufficiently in sync with other clocks in the distributed system.
// We used to try and adjust for the local clock being skewed, but there are cases where this is not accurate.
// The current implementation allows for the local clock to be -infinity to +MatrixRTCSession.MEMBERSHIP_EXPIRY_TIME/2
return this.getAbsoluteExpiry() - Date.now();
Copy link
Member

Choose a reason for hiding this comment

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

It looks like the impl of this is taking the legacy bit from above? I would expect it to be the other way around, although that bit just returns 'undefined'...

Copy link
Member

@hughns hughns Jan 6, 2025

Choose a reason for hiding this comment

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

Two things have got conflated in this PR:

  1. Removing the legacy logic
  2. Implementing an expiry logic for the non-legacy code

I've removed the latter from this PR to make the review easier. It should go in another PR. What I have done is left some TODOs and commented out code in to help with this. If you would prefer that they are removed outright then we can do so.

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha, thanks. I think it was simple enough this would have been okay, it just wasn't obvious what was going on from reading through. Thanks though.

@hughns hughns added this pull request to the merge queue Jan 6, 2025
Merged via the queue into develop with commit ffd3c95 Jan 6, 2025
30 checks passed
@hughns hughns deleted the toger5/refactor-matrixrtcsession-part1-legacy branch January 6, 2025 17:41
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.

3 participants