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
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
js-ipfs/src/core/components/dht.js
Line 64 in 37801c1
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