Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

ipfs.dht.findprovs is passing cb in timeout position to libp2p findProviders #1322

Closed
@olizilla

Description

  • Version: 0.28.2
  • Platform: all
  • Subsystem: dht

Type: Bug

Severity: High

Description:

ipfs.dht.findprovs is passing cb in timeout position to libp2p findProviders, and so the call fails to return anything.

In the dht component in js-ipfs

self._libp2pNode.contentRouting.findProviders(key, callback)

and the js-libp2p findProviders impl https://github.com/libp2p/js-libp2p/blob/03faf69212b0f3501291527f85b2bb85a8c5427e/src/content-routing.js#L5

Steps to reproduce the error:

In a browser with ipfs-companion installed and pointing at an embedded ipfs node:

ipfs.dht.findprovs('QmYPNmahJAvkMTU6tDx5zvhEkoLzEFeTDz6azDCSNqzKkW', console.log)
// Error: callback is not a function at Object.findProviders
jsipfs findprovs QmYPNmahJAvkMTU6tDx5zvhEkoLzEFeTDz6azDCSNqzKkW
// returns nothing, but exits cleanly

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps upexp/noviceSomeone with a little familiarity can pick upkind/bugA bug in existing code (including security flaws)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions