Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement js,wasm DataChannel OnError & OnClosing #3030

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

WofWca
Copy link
Member

@WofWca WofWca commented Feb 10, 2025

Description

  • feat: implement js,wasm DataChannel.OnError
  • feat: implement js,wasm DataChannel.OnClosing

FYI OnClosing is not implemented in the non-JS version of Pion,
so this is a JS-only method. Please consider if this is a good idea.

This is a follow-up to #479.

FYI I have not tested the OnError event (in particular obtaining errorMessage), but the both methods are largely copy-pasted from similar ones.

Reference issue

Partially addresses #519 (comment).


If I may, @albrow thank you so much for the initial implementation!
It's a bliss that it "just works"!

Copy link

codecov bot commented Feb 10, 2025

Codecov Report

Attention: Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.

Project coverage is 78.34%. Comparing base (59c7270) to head (e0a45f0).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
datachannel_js.go 0.00% 31 Missing and 2 partials ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3030      +/-   ##
==========================================
- Coverage   78.54%   78.34%   -0.20%     
==========================================
  Files          89       89              
  Lines       11078    11111      +33     
==========================================
+ Hits         8701     8705       +4     
- Misses       1890     1917      +27     
- Partials      487      489       +2     
Flag Coverage Δ
go 80.12% <ø> (+0.03%) ⬆️
wasm 63.39% <0.00%> (-0.52%) ⬇️

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

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

FYI `OnClosing` is not implemented in the non-JS version of Pion,
so this is a JS-only method.
@WofWca WofWca force-pushed the wofwca/datachannel_js-onerror-onclosing branch from a44bbad to e0a45f0 Compare February 10, 2025 22:05
@Sean-Der
Copy link
Member

Thank you @WofWca!

I went to write some tests, but wrtc supports neither :(

@Sean-Der Sean-Der merged commit 4ee3747 into master Feb 11, 2025
17 of 18 checks passed
@Sean-Der Sean-Der deleted the wofwca/datachannel_js-onerror-onclosing branch February 11, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants