-
Notifications
You must be signed in to change notification settings - Fork 509
Description
I noticed an issue when I have to nodes in two browser tabs, and I refresh on of the tabs. The connection is able to resume immediately, but
- After a few seconds the WebRTC connection closes in the tab that did not refresh (even though the client in both tabs are live and connected)
- The tab that refreshes still thinks the connection is live which makes messages not delivering
To reproduce the issues partially:
Put a log here
https://github.com/libp2p/js-libp2p-webrtc/blob/efe5ce70bdffdb67c237cfb4688afd562528a050/src/maconn.ts#LL68C9-L68C9
and run the browser-to-browser example.
Node 1 connects to the relay, and Node 2 connects to Node 1 relayed address.
After connection, close Node 2 and observe that the state change does not appear immediately in the logs.
--
If Node 2 would restart with the same PeerId and connects to Node 1 before the state change has happened, Node 1 will terminate Node 2 wrongfully as
will bubble up.
Since the browser-to-browser example is using new PeerIds each time the issue becomes less severe, but in real world scenarios where you run nodes with the same PeerId you will have nodes running with broken connections, as one side of the connection has wrongfully terminated it due to the reason outlined above.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status