On agent disconnect and reconnect, track_subscribed event reports track.muted as True even when muted
Tryptophan opened this issue · 0 comments
Tryptophan commented
I've found a bug with agents where on disconnecting/reconnecting due to temporary network failures then subscribing to a participant track the track reports as not muted even when it is muted. To reproduce use the following code and steps.
Steps to reproduce:
- Join a room with a participant and publish an audio stream
- Mute the audio stream
- Manually disconnect internet connection (where agent is hosted) and reconnect when livekit agent logs disconnect
- On re-connection of the agent the following code will log even though the participant is muted
def on_track_subscribed(
track: rtc.Track,
pub: rtc.RemoteTrackPublication,
remote_participant: rtc.participant.RemoteParticipant,
):
if track.kind == rtc.TrackKind.KIND_AUDIO and not track.muted:
logging.info("this should not log when participant is muted")
job.room.on("track_subscribed", on_track_subscribed)