-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: WebRTC transport unhandled promise rejection during connect (#2299)
Fixes a crash in node where the abort signal passed into a WebRTC private to private dial would cause an unhandled promise rejection: ``` file:///Users/alex/Documents/Workspaces/ipfs/helia-http-gateway/node_modules/@libp2p/webrtc/dist/src/private-to-private/initiate-connection.js:42 connectedPromise.reject(new CodeError('SDP handshake aborted', 'ERR_SDP_HANDSHAKE_ABORTED')); ^ CodeError: SDP handshake aborted at EventTarget.sdpAbortedListener (file:///Users/alex/Documents/Workspaces/ipfs/helia-http-gateway/node_modules/@libp2p/webrtc/dist/src/private-to-private/initiate-connection.js:42:37) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:807:20) at EventTarget.dispatchEvent (node:internal/event_target:742:26) at abortSignal (node:internal/abort_controller:369:10) at AbortController.abort (node:internal/abort_controller:391:5) at EventTarget.onAbort (file:///Users/alex/Documents/Workspaces/ipfs/helia-http-gateway/node_modules/any-signal/dist/src/index.js:8:20) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:807:20) at EventTarget.dispatchEvent (node:internal/event_target:742:26) at abortSignal (node:internal/abort_controller:369:10) at AbortController.abort (node:internal/abort_controller:391:5) { code: 'ERR_SDP_HANDSHAKE_ABORTED', props: {} } Node.js v20.8.0 ``` Simplifies the connection logic to just use the abort signal to abort the dial instead of the abort signal and multiple deferred promises. --------- Co-authored-by: Chad Nehemiah <chad.nehemiah94@gmail.com>
- Loading branch information
1 parent
57944fa
commit 64a915a
Showing
6 changed files
with
81 additions
and
78 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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