This message was deleted.
# announcements
s
This message was deleted.
d
are you able to reproduce this with either the react example or js example app?
if so, please share the steps and we'll take a look.
c
I can probably put one together
🙏 1
I've narrowed it down to a specific line of code that causes the problem. When a track is unsubscribed, we are calling track.mediaStreamTrack.stop(). This seems to put LiveKit in a bad state. If this line is removed, the track publications don't have an issue going back to the other side. Sample app that illustrates this issue https://gist.github.com/jezell/208e9ec3d042ad9a44347fb95f892696 https://gist.github.com/jezell/e6fc211ce990ca229e6b233af5ec2e91 Maybe there is some kind of bug introduced when tracks are manually stopped during a TrackUnsubscribed event?
This is likely the cause of a similar issue I had reported earlier (https://livekit-users.slack.com/archives/C01KZ61HZRR/p1663740429177429), since that code path would have also been activating this code which cleans up tracks when they are removed.
d
thank you for the detailed report. That is indeed the issue. LiveKit re-uses the transceivers in the peerconnection to avoid bloating the clients. because of that, when you
stop
a MediaStreamTrack directly, it would fail the next time the transceiver is reused. We'll add a note about this in our documentation
👍 1
c
Maybe it could also provide some kind of error in the console when that happens or it could detect that it needs to not re-use the transceiver if the track has been stopped? We probably don't need to stop the mediaStreamTrack, but would have been a lot easier to track down the issue if at something had been written out to the console.
d
that's a great idea.. we should log a warning here.
I think failing the subscription is the prudent thing to do here. We cannot control if the server reuses the transceiver or not. (the spec allows for it, and client stopping it locally doesn't give server any indication of it)