matrix-org / waterfall

A cascading stream forwarding unit for scalable, distributed voice and video conferencing over Matrix
Apache License 2.0
97 stars 5 forks source link

Rethink (refactor) `participant` package #128

Open daniel-abramov opened 1 year ago

daniel-abramov commented 1 year ago

The current participant package is not particularly useful, since Participant only provides public fields and does not do any encapsulation. The only reason it was moved there is the Tracker implementation. Tracker was created to ensure that 3 entities: subscriptions, published tracks, and participants are in sync.

However, after tackling https://github.com/matrix-org/waterfall/issues/120 and https://github.com/matrix-org/waterfall/issues/117, the published track along with its subscribers is extracted into its own package.

This means that the only thing that Tracker synchronized are 2 fields: participants and published tracks. It's easy to see that published tracks actually belong to the participant structure (and it was implemented like this at the beginning), however, they were split so that we could do a fast look-up of the published tracks by their IDs, which was required to ensure:

So once it's done, it would be good to review the participant and refactor it, so that: