Repository navigation
Revert PR #4838 in favor of a better solution - #4840
Merged
Merged
Conversation
Since livekit#4136 (v1.10.0) nothing registers SubscriptionManager.OnSubscribeStatusChanged, so Room.onSubscribeStatusChanged is never invoked. A participant that subscribes to another one after its first ConnectionQualityUpdate therefore never receives that participant's quality until a level changes (the client shows UNKNOWN indefinitely), and the speaker state a new subscriber used to receive is not sent either. Deterministic with autoSubscribe: false; a race for auto-subscribe when the 5s quality tick lands between the participant becoming ACTIVE and its subscriptions being registered. Fix: register the callback again in setupSubscriptionManager, forwarding to the participant listener, which is I think where livekit#4136 intended to do.
Matches the subscribe notification, so a quick track close + resubscribe cannot deliver a stale `false` after the following `true`. Drops the test comment describing the old goroutine delivery. Restores the trailing newline in room.go.
boks1971
approved these changes
Sep 4, 2026
pabloFuente
added a commit
to OpenVidu/openvidu-livekit
that referenced
this pull request
Sep 4, 2026
(cherry picked from commit a8ce398)
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #4136 (v1.10.0) nothing registers
SubscriptionManager.OnSubscribeStatusChanged, soRoom.onSubscribeStatusChangedis never invoked. That event handler (https://github.com/livekit/livekit/blob/407fe3fe26f7aad72f1307f01020d9a7671de6d8/pkg/rtc/room.go#L1317C16-L1317C40) took care of precisely sending network quality updates, as well as speaker state updates.If you perform a string search with Match Case and Whole Word of
OnSubscribeStatusChangedin repository livekit/livekit, you can see that it is dead code. Not called a single time anywhere in the code.Fix: register the callback again in
participant.go, methodsetupSubscriptionManager, forwarding to the participant listener (which is where #4136 intended it to go). The addition of this simple listener allows removing all the previous, more complex logic ofroom.go, fixing in the process the sending of speaker state events as well.Bug proof
The code snippet to proof the bug and this solution remains valid as in PR #4838:
Run livekit-server:
Create a temporal folder, initialize a go project and install the LiveKit Go SDK:
Now store this
main.gofile in that same foldercqproof:Then just run the go file and wait for the output:
The livekit-server in
mainwill output something like:A livekit-server with this PR merged outputs: