mirror of
https://github.com/livekit/livekit.git
synced 2026-04-04 14:45:43 +00:00
* Notify initial permissions NOTE: This does add an initial subscription permission notification which should be fine, but something to watch for. A stress test combining - mute/unmute on publisher side. - allowing/revoking permission for subscriber from publisher side. - subscribing/unsubscribing from subscriber side. results in a scenario where a subscription permission update of `not_allowed` being sent and on a re-subscribe, an `allowed` update does not happen. It happens like so - Subscription revoke cloes the down track of subscriber. - The subscription is still desired. - So, a subscription reconcile runs and sees `permission: false`. This sends subscription permission of `not_allowed`. - Unsubscribe request comes in and sets `desired: false`. - Reconsiler runs again and sees `desired: false` and `subscribedTrack: nil`. This cleans up the subscription. - Publisher grants permission for the subscriber. - Subscriber subscribes to the track again. A new subscription is created. - Reconciler runs and sees `permission: true`, but there is no permission change as it is a new subscription object. So, `allowed` subscription permission update is not sent and the client is stuck at `not_allowed`. Fix, maintain if permission has been initialized. Has the effect of sending an initial update which should be fine. * clean up comment * no default