Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/popular-mugs-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@livekit/components-core": patch
---

fix(core): dedupe transcriptions based on segment id
7 changes: 6 additions & 1 deletion packages/core/src/components/textStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ export function setupTextStream(room: Room, topic: string): Observable<TextStrea
// Subscribe to the stream and update our array when new chunks arrive
streamObservable.subscribe((accumulatedText) => {
// Find and update the stream in our array
const index = textStreams.findIndex((stream) => stream.streamInfo.id === reader.info.id);
const index = textStreams.findIndex(
(stream) =>
stream.streamInfo.id === reader.info.id ||
stream.streamInfo.attributes?.['lk.segment_id'] ===
reader.info.attributes?.['lk.segment_id'],
);
if (index !== -1) {
textStreams[index] = {
...textStreams[index],
Expand Down