Skip to content

Improve resilience of findAndConnect #226

@jacobheun

Description

@jacobheun

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 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low: Not priority right noweffort/hoursEstimated to take one or several hoursexp/noviceSomeone with a little familiarity can pick uphelp wantedSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)need/triageNeeds initial labeling and prioritizationstatus/readyReady to be worked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions