Js-ipfs: Fail non-silently when things are unimplemented

Created on 15 Oct 2018  路  3Comments  路  Source: ipfs/js-ipfs

  • Version:
    commit: ""
    repo: 7
    version: "0.32.3"

  • Platform:

  • uname -srvpoi > Linux 4.15.0-33-generic #36~16.04.1-Ubuntu SMP Wed Aug 15 17:21:05 UTC 2018 x86_64 x86_64 GNU/Linux
  • Chrome Version 69.0.3497.92 (Official Build) (64-bit)
  • Subsystem: files (?)

Type: Enhancement

Severity: Medium

Description:

files.add(blob, { chunker: 'rabin' }) fails silently by returning an empty array when running in browser. It would be immensely helpful for me if these kinds of silent failures were non-silent. As it is, I wasted 1 hour figuring out why this call was failing. If you throw "unimplemented errors" in a uniform way, it could also help newcomers find areas where they can help.

The reason this is important to me is that I'm using IPFS to store some game state, and the game server can run either in-browser or on Node - using the same code.

Steps to reproduce the error:

  • Add some data with files.add using the rabin chunker.
  • Observe that the callback receives an empty array in response.
P2 help wanted kinbug

Most helpful comment

ipfs/js-ipfs-unixfs-engine#230 is fixed but even once it's been released our use of the pull-sort module here causes errors to be swallowed.

I've opened a https://github.com/pull-stream/pull-sort/pull/2 to fix the problem. Once that's merged & released the errors should flow.

All 3 comments

Thanks for reporting @OliverUv - this should definitely not be the case! I've opened an issue here https://github.com/ipfs/js-ipfs-unixfs-engine/issues/230 to track.

ipfs/js-ipfs-unixfs-engine#230 is fixed but even once it's been released our use of the pull-sort module here causes errors to be swallowed.

I've opened a https://github.com/pull-stream/pull-sort/pull/2 to fix the problem. Once that's merged & released the errors should flow.

Was this page helpful?
0 / 5 - 0 ratings