Skip to content

Commit b74e9df

Browse files
lukasIOsvajunas-budrys
authored andcommitted
Remove TextStream controllers on stream close (livekit#1422)
1 parent 72dd989 commit b74e9df

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.changeset/cyan-jokes-run.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"livekit-client": patch
3+
---
4+
5+
fix: properly remove text stream controllers on stream close

src/room/Room.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,14 +1866,13 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
18661866

18671867
private handleStreamTrailer(trailer: DataStream_Trailer) {
18681868
const textBuffer = this.textStreamControllers.get(trailer.streamId);
1869-
18701869
if (textBuffer) {
18711870
textBuffer.info.attributes = {
18721871
...textBuffer.info.attributes,
18731872
...trailer.attributes,
18741873
};
18751874
textBuffer.controller.close();
1876-
this.byteStreamControllers.delete(trailer.streamId);
1875+
this.textStreamControllers.delete(trailer.streamId);
18771876
}
18781877

18791878
const fileBuffer = this.byteStreamControllers.get(trailer.streamId);

0 commit comments

Comments
 (0)