Skip to content

Fix subscriber data channel state events reporting the wrong channel - #1172

Merged
hiroshihorie merged 1 commit into
mainfrom
hiroshi/fix-subscriber-dc-state-events
Aug 11, 2026
Merged

Fix subscriber data channel state events reporting the wrong channel#1172
hiroshihorie merged 1 commit into
mainfrom
hiroshi/fix-subscriber-dc-state-events

Conversation

@hiroshihorie

Copy link
Copy Markdown
Member

_onDataChannel registered a nested listener: every state change on a subscriber data channel attached a new listener to the publisher reliable channel and emitted SubscriberDataChannelStateUpdatedEvent from that channel's state instead. So subscriber state changes produced no immediate event, the events that did arrive carried the publisher channel's state (for the lossy label too), and inner listeners accumulated uncancelled for the lifetime of the connection.

Now each subscriber channel emits its own state directly from a single listener, mirroring the publisher-side wiring.

Also initializes the late stateChangeStream field in MockDataChannel, which previously threw LateInitializationError whenever engine code touched it in tests. Regression test verified to fail against the old wiring.

Pre-existing bug surfaced by Devin on the #1170 reformat diff, fixed separately to keep that PR mechanical.

@hiroshihorie
hiroshihorie marked this pull request as ready for review August 11, 2026 09:50

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@hiroshihorie
hiroshihorie merged commit 2328913 into main Aug 11, 2026
15 checks passed
@hiroshihorie
hiroshihorie deleted the hiroshi/fix-subscriber-dc-state-events branch August 11, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants