js-libp2p
js-libp2p copied to clipboard
[switch] Prevent callback from being called more than once in LimitDialer
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 is this still an issue?
yes, this is still an issue.
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.