Select which package(s) are affected
@livekit/rtc-node
Describe the bug
race condition in track subscription.
We have some code that that kept crashing our server yesterday. There's a problem with this line:
|
publication!.resolveFirstSubscription(); |
Where sometimes (it's really unclear when) the publication can be undefined:
TypeError#1: undefined is not an object (evaluating 'publication.resolveFirstSubscription')
You can see on that line that there's a ! in the typescript, so lint must have seen it.
This happened when we were reconnecting to a room with same participant name, same room name. So maybe the track was still published from the previous connection?
Reproduction
unfortunately not sure
Logs
System Info
Bun 1.2.8
"@livekit/rtc-node": "^0.13.10",
"livekit-server-sdk": "^2.11.0",
LiveKit server version
LiveKit cloud
Severity
annoyance
Additional Information
No response
Select which package(s) are affected
@livekit/rtc-node
Describe the bug
race condition in track subscription.
We have some code that that kept crashing our server yesterday. There's a problem with this line:
node-sdks/packages/livekit-rtc/src/room.ts
Line 262 in f198246
Where sometimes (it's really unclear when) the publication can be undefined:
You can see on that line that there's a ! in the typescript, so lint must have seen it.
This happened when we were reconnecting to a room with same participant name, same room name. So maybe the track was still published from the previous connection?
Reproduction
unfortunately not sure
Logs
System Info
LiveKit server version
LiveKit cloud
Severity
annoyance
Additional Information
No response