-
Notifications
You must be signed in to change notification settings - Fork 1.3k
object.get sometimes returns an empty DAGNode #359
Comments
This is a bug in js-ipfs-repo. Node streams are not working properly for fs-blob-store when reading and writing a lot. |
This is an example on how this can be fixed https://gist.github.com/dignifiedquire/b98e2f1caf6c549c0e04895c88e8ca3d |
@dignifiedquire could you make a diff instead of a gist? (and better, a PR) |
@diasdavid no I can not, as this is just a hack. If you look closely it stops using the abstract-blob-store interface and so would immediately stop working in the browser. As far as I can tell this can not be fixed as long as we use abstract-blob-store with node-streams to read and write files. |
Got it, what I meant was that it is hard to check what changed when there is no diff. Yes, changing from stream to sync write is not the solution. |
I think the problem here was, iirc discussion with @dignifiedquire, that fs.createReadStream in abstract-blob-store was not working as expected. So, his fix was to change the fs layer to use .writeFile (async) instead of streams. |
This should be fixed once #403 is done |
#403 was merged and should fix this, please reopen if this is still an issue |
@haadcode please verify :) |
Sometimes, when doing
object.get
, the result is an empty DAGNode, ie.res.toJSON().Data
--> empty buffer). The hash involved is probably thisQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n
seeing it around a lot.This has been around since 0.1x.x and is still present in 0.14.1.
The text was updated successfully, but these errors were encountered: