mirror of
https://github.com/livekit/livekit.git
synced 2026-11-23 02:29:22 +00:00
subscribeDataTrack checks the publisher's permission when it resolves the data track and records the subscriber on the track afterwards. A publisher revoke removes only the subscribers already recorded on its data tracks, so a subscribe that passed the check before the revoke and was recorded after it is never removed. The subscriber keeps receiving a data track it is no longer allowed to receive. Resolve the track again once the subscriber is recorded, as is already done for canSubscribe. If it is still the same data track and permission is now denied, remove the subscriber and return ErrNoTrackPermission. The reconcile that follows records the denial, tells the client, and keeps the subscription waiting until permission is granted again.