Skip to content

Notify when a stream reset completes - #511

Open
idy wants to merge 1 commit into
pion:mainfrom
GizClaw:fix/stream-reset-complete
Open

idy wants to merge 1 commit into
pion:mainfrom
GizClaw:fix/stream-reset-complete

Conversation

@idy

@idy idy commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Applications that reuse stream IDs (WebRTC data channels) cannot tell when a reset has finished, and reusing an ID too early lets late reset traffic for the old stream hit the new one. This adds OnStreamResetComplete, called once after both the incoming and outgoing resets are done and the stream is removed.

Split out of #494; overlaps with #463.

🤖 Generated with Claude Code

@idy
idy force-pushed the fix/stream-reset-complete branch from 0e1ea69 to ba85306 Compare September 20, 2026 14:50
@codecov

codecov Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.63%. Comparing base (b872f59) to head (76e06ca).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #511      +/-   ##
==========================================
+ Coverage   85.52%   85.63%   +0.10%     
==========================================
  Files          56       56              
  Lines        5487     5508      +21     
==========================================
+ Hits         4693     4717      +24     
+ Misses        559      556       -3     
  Partials      235      235              
Flag Coverage Δ
go 85.63% <100.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread association_stream_reset_complete_test.go
@idy
idy force-pushed the fix/stream-reset-complete branch from ba85306 to 1c6e67e Compare September 20, 2026 15:40
An application that reuses stream identifiers, such as WebRTC data
channels, has no way to learn when a stream's reset has finished.
Reusing the identifier earlier lets a late reset request or response
for the old stream act on the new one.

Add OnStreamResetComplete. The handler is called once per stream,
after the stream has been removed and both the incoming reset from
the peer and the acknowledgement of our own outgoing reset have
arrived, so the identifier can safely be reused.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@idy
idy force-pushed the fix/stream-reset-complete branch from 1c6e67e to 76e06ca Compare September 21, 2026 18:35
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