Skip to content

Commit d71f8fa

Browse files
authored
Only react to topics defined in the message observable (livekit#516)
1 parent cc59b7f commit d71f8fa

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/dry-turkeys-return.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@livekit/components-core": patch
3+
---
4+
5+
Fix: Only react to topics defined in the message observable

packages/core/src/observables/dataChannel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function setupDataMessageHandler<T extends string>(
4545
) {
4646
/** Setup a Observable that returns all data messages belonging to a topic. */
4747
const messageObservable = createDataObserver(room).pipe(
48-
filter(([, , , messageTopic]) => messageTopic === undefined || messageTopic === topic),
48+
filter(([, , , messageTopic]) => topic === undefined || messageTopic === topic),
4949
map(([payload, participant, , messageTopic]) => {
5050
const msg = {
5151
payload,

0 commit comments

Comments
 (0)