Closed mistakia closed 2 years ago
Supersedes #28 Closes #28
@haadcode @mistakia @vinkabuki
I was about to comment on #28 and found here, which to me looks like it solves the problem described in https://github.com/orbitdb/orbit-db/issues/947.
Would it be possible to capture the error in a test, and then verify that this PR indeed fixes it?
I've noticed that some of my tests hang because of the waitForPeers timer is not resolving.
I believe what is happening is a test spins up two nodes, node1 resolves and closes the connection before node2 resolves, thus leaving node2 waiting for peers. The timer on node2 continues to run when the test ends and the channels are closed.
I've added a check in the timer to see if the channel has been closed to clear the timer.