File tree Expand file tree Collapse file tree
src/room/data-track/incoming Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " livekit-client " : patch
3+ ---
4+
5+ Close streamcontrollers when datatrack gets unpublished
Original file line number Diff line number Diff line change @@ -436,6 +436,9 @@ export default class IncomingDataTrackManager extends (EventEmitter as new () =>
436436 this . descriptors . delete ( sid ) ;
437437
438438 if ( descriptor . subscription . type === 'active' ) {
439+ descriptor . subscription . streamControllers . forEach ( ( controller ) => {
440+ controller . close ( ) ;
441+ } ) ;
439442 this . subscriptionHandles . delete ( descriptor . subscription . subcriptionHandle ) ;
440443 }
441444
@@ -583,6 +586,10 @@ export default class IncomingDataTrackManager extends (EventEmitter as new () =>
583586 if ( descriptor . subscription . type === 'pending' ) {
584587 descriptor . subscription . completionFuture . reject ?.( DataTrackSubscribeError . disconnected ( ) ) ;
585588 }
589+
590+ if ( descriptor . subscription . type === 'active' ) {
591+ descriptor . subscription . streamControllers . forEach ( ( controller ) => controller . close ( ) ) ;
592+ }
586593 }
587594 this . descriptors . clear ( ) ;
588595 }
You can’t perform that action at this time.
0 commit comments