-
Notifications
You must be signed in to change notification settings - Fork 198
Issue with Unpublishing Tracks – Remote Participants Still See Tracks of unpublished user #1429
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
Comments
thanks for the report, this is rather unexpected, in order to investigate this further please post debug logs from
|
I have updated the issue and added server logs |
use this code for unpublish tracks :
|
I will provide two parts of logs. The first one is for when I unpublish a user and the Seconf one is when new user join and can see the unpublished user: Log1 Unpublish User : |
Log 2 New user join: |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
When the number of participants is small (e.g., 10 or fewer), if a participant unpublishes all their tracks, their videoTrack and audioTrack become null in the room.remoteParticipants list of other users. This works as expected, and new participants who join later cannot subscribe to the unpublished participant.
However, when the number of participants exceeds 20-30-40, …, unpublishing does not work as expected. The participant who unpublishes still has video and audio tracks in the room.remoteParticipants object for other users.
The unsubscribed signal does trigger for existing participants in the meeting, and they correctly unsubscribe from the unpublished participant.
However, when a new participant joins the room, they are still able to subscribe to the unpublished participant’s tracks, even though the tracks were unpublished earlier.
Why does this issue happen only when the participant count is high?
Why do existing participants correctly receive the unsubscribe event, but new participants can still subscribe to the unpublished user?
Is there a way to force all remote participants, including new joiners, to update and recognize when a user has unpublished all their tracks?
Could this be related to LiveKit’s track subscription management for scalability?
What’s the best way to ensure that a new participant does not subscribe an unpublished user?
Reproduction
1- Set up a LiveKit room with a large number of participants (e.g., 20-30 or more).
2- Publish more than 20 tracks: Ensure all participants publish both video and audio tracks.
3- Create a function to unpublish users randomly in a web app server(I do that by sending websocket)
4- When a new user joins the meeting, he can see the unpublished user! but existing users get a signal that the user is unpublished!
Logs
ound for fe80::f816:3eff:fe79:4961%ens3 {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "شششش (مهمان)&&14178558", "pID": "PA_aZZyJENnN3z9", "remote": false, "transport": "PUBLISHER"}
2025-03-06T09:58:37.673Z INFO livekit.transport rtc/transport.go:546 ice reconnected or switched pair {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "شششش (مهمان)&&14178558", "pID": "PA_aZZyJENnN3z9", "remote": false, "transport": "PUBLISHER", "existingPair": {"localProtocol": "udp", "localCandidateType": "host", "localAdddress": "87.247.171.231", "localPort": 59327, "remoteProtocol": "udp", "remoteCandidateType": "relay", "remoteAdddress": "87.247.171....", "remotePort": 46950, "relatedAdddress": "2.177.85...", "relatedPort": 49419}, "newPair": {"localProtocol": "udp", "localCandidateType": "host", "localAdddress": "87.247.171.231", "localPort": 59327, "remoteProtocol": "udp", "remoteCandidateType": "prflx", "remoteAdddress": "2.177.85...", "remotePort": 43315}}
2025-03-06T09:58:38.540Z INFO livekit rtc/room.go:472 participant active {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "شششش (مهمان)&&14178558", "pID": "PA_aZZyJENnN3z9", "remote": false, "publisherCandidates": ["[local][selected:2][trickle] udp4 host 87.247.171.231:59327 (resolved: 87.247.171.231:59327)", "[local][trickle] tcp4 host 87.247.171.231:7881 (resolved: 87.247.171.231:7881)", "[local][trickle] udp4 host 87.247.171.231:50681 (resolved: 87.247.171.231:50681)", "[remote][trickle] udp4 host 172.21.224.1:49418", "[remote][trickle] udp4 host 192.168.7.58:49419", "[remote][trickle] udp4 srflx 2.177.85...:49419 related 192.168.7.58:49419", "[remote][selected:1][trickle] udp4 relay 87.247.171....:46950 related 2.177.85...:49419", "[remote][trickle] tcp4 host 172.21.224.1:9", "[remote][trickle] tcp4 host 192.168.7.58:9", "[remote][selected:2][trickle] udp4 prflx 2.177.85...:43315"], "subscriberCandidates": ["[local][selected:1][trickle] udp4 host 87.247.171.231:51179 (resolved: 87.247.171.231:51179)", "[local][trickle] tcp4 host 87.247.171.231:7881 (resolved: 87.247.171.231:7881)", "[local][trickle] udp4 host 87.247.171.231:54715 (resolved: 87.247.171.231:54715)", "[remote][trickle] udp4 host 172.21.224.1:49416", "[remote][trickle] udp4 host 192.168.7.58:49417", "[remote][trickle] udp4 srflx 2.177.85...:49417 related 192.168.7.58:49417", "[remote][trickle] udp4 relay 87.247.171....:48260 related 2.177.85...:49417", "[remote][selected:1][trickle] udp4 prflx 2.177.85...:39861"], "connectionType": "udp"}
2025-03-06T09:58:38.554Z INFO livekit.webhook webhook/url_notifier.go:124 sent webhook {"event": "participant_joined", "id": "EV_PireUP7AVSyF", "webhookTime": 1741255118, "room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "شششش (مهمان)&&14178558", "pID": "PA_aZZyJENnN3z9", "url": "https://openvidu.shooka.com/shooka/livekit/webhook", "queueDuration": "91.797µs", "sendDuration": "14.150758ms"}
2025-03-06T09:58:38.700Z INFO livekit.pub rtc/participant.go:1797 mediaTrack published {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "شششش (مهمان)&&14178558", "pID": "PA_aZZyJENnN3z9", "remote": false, "kind": "video", "trackID": "TR_VChkjapSVTvm6p", "webrtcTrackID": "a22cbaa6-c4f5-4fdb-b547-7623c65ecf71", "rid": "", "SSRC": 4066708971, "mime": "video/VP8", "trackInfo": {"sid": "TR_VChkjapSVTvm6p", "type": "VIDEO", "width": 320, "height": 240, "source": "CAMERA", "layers": [{"quality": "HIGH", "width": 320, "height": 240, "bitrate": 150000, "ssrc": 4066708971}], "mimeType": "video/VP8", "mid": "1", "codecs": [{"mimeType": "video/VP8", "mid": "1", "cid": "a22cbaa6-c4f5-4fdb-b547-7623c65ecf71", "layers": [{"quality": "HIGH", "width": 320, "height": 240, "bitrate": 150000, "ssrc": 4066708971}]}], "encryption": "NONE", "stream": "camera", "version": {"unixMicro": 1741255118700116}}, "fromSdp": true}
2025-03-06T09:58:38.711Z INFO livekit.webhook webhook/url_notifier.go:124 sent webhook {"event": "track_published", "id": "EV_ebugdJ3uyKxj", "webhookTime": 1741255118, "room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "شششش (مهمان)&&14178558", "pID": "PA_aZZyJENnN3z9", "url": "https://openvidu.shooka.com/shooka/livekit/webhook", "queueDuration": "50.435µs", "sendDuration": "8.890406ms"}
2025-03-06T09:58:38.756Z INFO livekit.pub rtc/participant.go:1797 mediaTrack published {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "شششش (مهمان)&&14178558", "pID": "PA_aZZyJENnN3z9", "remote": false, "kind": "audio", "trackID": "TR_AMwGbinhLPvBSC", "webrtcTrackID": "21e11878-befb-45b8-8a80-849d046ae2e9", "rid": "", "SSRC": 1596252099, "mime": "audio/opus", "trackInfo": {"sid": "TR_AMwGbinhLPvBSC", "type": "AUDIO", "source": "MICROPHONE", "mimeType": "audio/opus", "mid": "2", "disableRed": true, "encryption": "NONE", "stream": "camera", "version": {"unixMicro": 1741255118756486}}, "fromSdp": true}
2025-03-06T09:58:38.768Z INFO livekit.webhook webhook/url_notifier.go:124 sent webhook {"event": "track_published", "id": "EV_abUttAVgHLnL", "webhookTime": 1741255118, "room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "شششش (مهمان)&&14178558", "pID": "PA_aZZyJENnN3z9", "url": "https://openvidu.shooka.com/shooka/livekit/webhook", "queueDuration": "16.996µs", "sendDuration": "11.099791ms"}
2025-03-06T09:58:58.869Z INFO livekit.sub rtc/subscriptionmanager.go:386 unsubscribing from track after notFoundTimeout {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "fNjzoII (مهمان)&&17483322", "pID": "PA_bM6FsNDVfpbd", "remote": false, "trackID": "TR_VCyqwq4vzj4NX9", "error": "track cannot be found"}
2025-03-06T09:58:58.912Z INFO livekit.sub rtc/subscriptionmanager.go:386 unsubscribing from track after notFoundTimeout {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "سپهر (مهمان)&&12038593", "pID": "PA_xXpZpyU7eknM", "remote": false, "trackID": "TR_VCyqwq4vzj4NX9", "error": "track cannot be found"}
2025-03-06T09:58:59.225Z INFO livekit.sub rtc/subscriptionmanager.go:386 unsubscribing from track after notFoundTimeout {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "eDebbkT (مهمان)&&14885654", "pID": "PA_KdMu37fw5swc", "remote": false, "trackID": "TR_AMTWguFwyn4AUL", "error": "track cannot be found"}
2025-03-06T09:58:59.226Z INFO livekit.sub rtc/subscriptionmanager.go:386 unsubscribing from track after notFoundTimeout {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "eDebbkT (مهمان)&&14885654", "pID": "PA_KdMu37fw5swc", "remote": false, "trackID": "TR_VCyqwq4vzj4NX9", "error": "track cannot be found"}
2025-03-06T09:58:59.650Z INFO livekit.sub rtc/subscriptionmanager.go:386 unsubscribing from track after notFoundTimeout {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "darush (مهمان)&&16492040", "pID": "PA_vbuNGMEvYj9v", "remote": false, "trackID": "TR_AMTWguFwyn4AUL", "error": "track cannot be found"}
2025-03-06T09:58:59.650Z INFO livekit.sub rtc/subscriptionmanager.go:386 unsubscribing from track after notFoundTimeout {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "darush (مهمان)&&16492040", "pID": "PA_vbuNGMEvYj9v", "remote": false, "trackID": "TR_VCyqwq4vzj4NX9", "error": "track cannot be found"}
2025-03-06T09:58:59.764Z INFO livekit.sub rtc/subscriptionmanager.go:386 unsubscribing from track after notFoundTimeout {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "راهبر شوک&&2", "pID": "PA_H8VPMoFebuiG", "remote": false, "trackID": "TR_VCyqwq4vzj4NX9", "error": "track cannot be found"}
2025-03-06T09:58:59.764Z INFO livekit.sub rtc/subscriptionmanager.go:386 unsubscribing from track after notFoundTimeout {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "راهبر شوک&&2", "pID": "PA_H8VPMoFebuiG", "remote": false, "trackID": "TR_AMTWguFwyn4AUL", "error": "track cannot be found"}
2025-03-06T09:59:00.027Z INFO livekit.sub rtc/subscriptionmanager.go:386 unsubscribing from track after notFoundTimeout {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "9NuJVGd (مهمان)&&14722836", "pID": "PA_zgSs6fJPXP4u", "remote": false, "trackID": "TR_AMTWguFwyn4AUL", "error": "track cannot be found"}
2025-03-06T09:59:00.027Z INFO livekit.sub rtc/subscriptionmanager.go:386 unsubscribing from track after notFoundTimeout {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "9NuJVGd (مهمان)&&14722836", "pID": "PA_zgSs6fJPXP4u", "remote": false, "trackID": "TR_VCyqwq4vzj4NX9", "error": "track cannot be found"}
2025-03-06T09:59:01.868Z INFO livekit.sub rtc/subscriptionmanager.go:386 unsubscribing from track after notFoundTimeout {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "fNjzoII (مهمان)&&17483322", "pID": "PA_bM6FsNDVfpbd", "remote": false, "trackID": "TR_AMTWguFwyn4AUL", "error": "track cannot be found"}
2025-03-06T09:59:01.912Z INFO livekit.sub rtc/subscriptionmanager.go:386 unsubscribing from track after notFoundTimeout {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "سپهر (مهمان)&&12038593", "pID": "PA_xXpZpyU7eknM", "remote": false, "trackID": "TR_AMTWguFwyn4AUL", "error": "track cannot be found"}
2025-03-06T09:59:05.650Z INFO livekit.sub rtc/subscriptionmanager.go:386 unsubscribing from track after notFoundTimeout {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "darush (مهمان)&&16492040", "pID": "PA_vbuNGMEvYj9v", "remote": false, "trackID": "TR_VCiKzGeWTVoib2", "error": "track cannot be found"}
2025-03-06T09:59:05.764Z INFO livekit.sub rtc/subscriptionmanager.go:386 unsubscribing from track after notFoundTimeout {"room": "3810", "roomID": "RM_zhgyobEj32c7", "participant": "راهبر شوک&&2", "pID": "PA_H8VPMoFebuiG", "remote": false, "trackID": "TR_VCiKzGeWTVoib2", "error": "track cannot be found"}
System Info
Severity
blocking all usage of LiveKit
Additional Information
No response
The text was updated successfully, but these errors were encountered: