You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
It is strange that same hash that during uploading had size 72 now displayed as zero-length.
The text was updated successfully, but these errors were encountered:
Rkrushanovskij
changed the title
getReadableStream returns Readable with length 0 after migrating to the latest ipfs-http-client
getReadableStream returns Readable with length 0 after migrating to the latest ipfs-http-client version
Jan 8, 2020
Rkrushanovskij
changed the title
getReadableStream returns Readable with length 0 after migrating to the latest ipfs-http-client version
getReadableStream returns Readable with length 0 after migration to the latest version
Jan 8, 2020
Are you using content._readableState.length? Firstly, I would suggest not depending on this value, by convention underscore prefixed members are considered private and are not usually part of the public API.
Secondly, streams by their nature are not guaranteed to know their length before they are consumed. There is nothing in the public API for streams that allows you to know this.
You could consume the stream and then you'd know the length or you can use ipfs.ls to get size information for a given file.
After migration to the latest
ipfs-http-client
version I faced troubles with getReadableStream.Versions:
32.0.1 -> 40.1.0
I am uploading file to IPFS from FS using:
ipfs.addFromFs(path, options)
and getting such result:
AFAIU it means that file uploaded successfully and this hash have some content (non-zero size).
I am trying to get readable stream from IPFS for this file but returned stream is 0 length:
ipfs.getReadableStream(hash)
It is strange that same hash that during uploading had size 72 now displayed as zero-length.
The text was updated successfully, but these errors were encountered: