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

fix: WebRTC transport unhandled promise rejection during connect #2299

Merged
merged 6 commits into from
Dec 5, 2023

Commits on Dec 5, 2023

  1. fix: WebRTC transport unhandled promise rejection during connect

    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.
    achingbrain committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    6367782 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e5f5c0d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4bae145 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9e3c5f7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4df8396 View commit details
    Browse the repository at this point in the history
  6. chore: add test

    achingbrain committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    f935c3a View commit details
    Browse the repository at this point in the history