libp2p / libp2p/js-libp2p

WebTransport throws NetworkError when creating a new stream on a (very) old connection

Open
#1,982 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

need/triage
Dominant language
TypeScript
Stars
2.6k
Forks
546
Avg merge
8h 18m
Merged PRs (30d)
16

Description

I opened a WebTransport connection to a peer, closed my laptop and forgot about it.

The next day I opened my laptop, the node still thinks it has a connection, connection.newStream() calls .createBidirectionalStream() on the WebTransport object which throws DOMException: Failed to execute 'createBidirectionalStream' on 'WebTransport': No connection..

We should handle this error. Probably abort the connection with the error?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the connection.newStream() entry point and trace its call to WebTransport.createBidirectionalStream(). Reproduce the stale-connection case after the laptop sleeps or disconnects, then determine the expected connection state and error handling; done means the NetworkError is handled consistently rather than escaping from newStream().

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.