Describe the bug
In short, whenever we change networks (e.g. from wifi -A- to mobile hotspot -B-) and we reuse the same identity (i.e. we rerun our application with the same database), we broadcast the same identity but over a different IP, making the bootstrap route the connection to a node that is no longer available (i.e. A is dead, as now we are B). This will cause,
On A, sending a message will throw Cannot read property 'stream' of undefined
On other nodes A will still show up as available node.
On other nodes connected to the network, at any point the console will be filled with the following error message:
> (node:63523) UnhandledPromiseRejectionWarning: Error: invalid ip provided: undefined
at module.exports (/Users/hopr/Projects/hopr/hopr-core/chat/node_modules/libp2p-utils/src/ip-port-to-multiaddr.js:15:19)
at Object.socketToConn (/Users/hopr/Projects/hopr/hopr-core/chat/node_modules/@hoprnet/hopr-core/lib/network/transport/socket-to-conn.js:52:41)
at Peer.onConnect (/Users/hopr/Projects/hopr/hopr-core/chat/node_modules/@hoprnet/hopr-core/lib/network/transport/index.js:286:86)
at Object.onceWrapper (events.js:297:20)
at Peer.emit (events.js:209:13)
at Peer._destroy (/Users/hopr/Projects/hopr/hopr-core/chat/node_modules/simple-peer/index.js:461:19)
at Peer.destroy (/Users/hopr/Projects/hopr/hopr-core/chat/node_modules/simple-peer/index.js:404:10)
at Peer._onIceStateChange (/Users/hopr/Projects/hopr/hopr-core/chat/node_modules/simple-peer/index.js:681:12)
at RTCPeerConnection.Peer._pc.oniceconnectionstatechange (/Users/hopr/Projects/hopr/hopr-core/chat/node_modules/simple-peer/index.js:116:12)
at /Users/hopr/Projects/hopr/hopr-core/chat/node_modules/wrtc/lib/eventtarget.js:37:18
at Set.forEach (<anonymous>)
at /Users/hopr/Projects/hopr/hopr-core/chat/node_modules/wrtc/lib/eventtarget.js:33:15
at processTicksAndRejections (internal/process/task_queues.js:75:11)
(node:63523) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
To Reproduce
Steps to reproduce the behavior:
Make sure you have the system on a development setup enabled (i.e. yarn and yarn build inside the chat folder already ran).
Run yarn start:alice under chat on a computer using wifi A (let's call this combination alice-A), crawl and send messages.
Reconnect with alice (same db, do not delete), but now on a new wifi or mobile hot spot B
When alice-B connects and tries to send messages, those messages will fail and pollute the network.
Expected behavioralice-A is now dropped from the DHT and alice-B is readded. alice-B can execute normal operations without failure nor network pollution (i.e. error messages show up in other nodes’ console).
Screenshots
What alice-B sees:
What other nodes might see:
Environment (please complete the following information):
Describe the bug In short, whenever we change networks (e.g. from wifi -
A
- to mobile hotspot -B
-) and we reuse the same identity (i.e. we rerun our application with the same database), we broadcast the same identity but over a different IP, making the bootstrap route the connection to a node that is no longer available (i.e.A
is dead, as now we areB
). This will cause,A
, sending a message will throwCannot read property 'stream' of undefined
A
will still show up as available node.To Reproduce Steps to reproduce the behavior:
yarn
andyarn build
inside thechat
folder already ran).yarn start:alice
underchat
on a computer using wifiA
(let's call this combinationalice-A
), crawl and send messages.alice
(samedb
, do not delete), but now on a new wifi or mobile hot spotB
alice-B
connects and tries to send messages, those messages will fail and pollute the network.Expected behavior
alice-A
is now dropped from the DHT andalice-B
is readded.alice-B
can execute normal operations without failure nor network pollution (i.e. error messages show up in other nodes’ console).Screenshots What
alice-B
sees:What other nodes might see:
Environment (please complete the following information):
Both
alice-B
and other Nodesalice-B
runningnode
binary, other nodes runningnode
runtime.