js-libp2p icon indicating copy to clipboard operation
js-libp2p copied to clipboard

[switch] Prevent callback from being called more than once in LimitDialer

Open dryajov opened this issue 8 years ago • 2 comments

The callback in LimitDialer gets called more than once in certain circumstances which breaks some async artifacts such as waterfall or parallel. I have currently patched this in https://github.com/libp2p/js-libp2p-swarm/pull/224/files#diff-0e91f710aa050de15c82e5d320bb289cR41 by using once, however as @dignifiedquire pointed out, we need something smarter that cancels pending requests and does the proper clean up. This issue is here to keep track of that change.

Also, the reason not to have this as part of https://github.com/libp2p/js-libp2p-swarm/pull/224, is to keep it from holding that PR, tho we probably want this fixed before shipping it.

dryajov avatar Sep 01 '17 15:09 dryajov

@dryajov is this still an issue?

daviddias avatar Feb 05 '18 11:02 daviddias

yes, this is still an issue.

dryajov avatar Feb 05 '18 17:02 dryajov

Many of these components have been refactored, so unsure if it's still applicable today. In case you do see this issue again, feel free to re-open or create a new issue.

p-shahi avatar May 30 '23 15:05 p-shahi