fix: add onInboundStreamNotification to keep onStreamAvailable backwards compatible#6
Closed
smoghe-bw wants to merge 1 commit into
Closed
Conversation
…mNotification callback Previously the signaling-layer streamAvailable WS event was routed through onStreamAvailable, which fires before the WebRTC ontrack event arrives and therefore has no mediaStream. This broke existing consumers who assume onStreamAvailable always carries a populated mediaStream. Introduce onInboundStreamNotification as the dedicated callback for the pre-media gateway notification (carries callId/autoAccepted, no mediaStream). onStreamAvailable continues to fire only from the WebRTC ontrack handler, so mediaStream is always present and existing consumers are unaffected. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Author
|
Superseded — changes pushed directly to metadata-for-stream-events. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
streamAvailableWS notification to fire before the WebRTContrackevent arrives. The feature branch wired this notification throughonStreamAvailable, but that callback previously always carried amediaStream— breaking existing consumers.onInboundStreamNotificationas the dedicated callback for the pre-media signaling notification (carriescallId/autoAccepted,mediaStreamis always undefined here).onStreamAvailableto only fire from the WebRTContrackhandler, wheremediaStreamis always present. Existing consumers are unaffected.Before / After
streamAvailableWSonStreamAvailablewith nomediaStreamonInboundStreamNotificationwithcallId/autoAcceptedontrackonStreamAvailablewithmediaStreamonStreamAvailablewithmediaStream(unchanged)Migration for consumers using the accept/decline flow
Replace
onStreamAvailableusage that inspectscallIdfor accept/decline withonInboundStreamNotification:Test plan
onInboundStreamNotificationfires first (no media), thenonStreamAvailablefires with a populatedmediaStreamonStreamAvailablefires (fromontrack),onInboundStreamNotificationnever firesonInboundStreamNotificationregistered — call connects normally, no errors🤖 Generated with Claude Code