Improve resilience of findAndConnect
- Dominant language
- TypeScript
- Stars
- 75
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
Currently findAndConnect uses Promise.all to connect to all found providers, https://github.com/ipfs/js-ipfs-bitswap/blob/v1.0.0/src/network.js#L137. If we find multiple providers and for some reason fail to connect to 1 of them, findAndConnect will fail.
In reality we probably only need at least 1 to succeed so it might be better to use something like [Promise.allSettled](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled) to avoid unnecessary failures.
The other promises aren't being aborted at the moment so it looks like this should still connect to available peers. As such, this likely isn't a big issue at the moment, but it should still be fixed.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.