-
Notifications
You must be signed in to change notification settings - Fork 124
Conversation
@@ -278,8 +275,7 @@ module.exports = (common) => { | |||
const hash = new Buffer(bs58.decode('QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB')) | |||
ipfs.cat(hash) | |||
.then((stream) => { | |||
stream.pipe(bl((err, bldata) => { | |||
expect(err).to.not.exist | |||
stream.pipe(concat((bldata) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bl
was nice cause it also catched any error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stream will still throw, which isn't as nice as the explicit handling.
Let me know if LGTM and I'll squash for ya! @diasdavid |
Merged the js-ipfs-unixfs-engine PR. Are these the ones missing on js-ipfs-api and js-ipfs to get the tests from files.get working there?
Let's squash these, get js-ipfs ready, both passing the tests and put a ✔️ on this :) |
@noffle I believe I unlocked you by merging and releasing the unixfs-engine PR. Let me know if you need anything else from me :) |
07539d6
to
a58ac3c
Compare
@noffle this is looking good. Could you squash the commits for the merge and also, follow ipfs-inactive/js-ipfs-unixfs-engine#52 (comment) so that PR gets merged too. Excited to have the get command finally in too :) |
stream.pipe(concat((files) => { | ||
expect(err).to.not.exist | ||
expect(files).to.be.length(1) | ||
expect(files[0].path).to.equal(hash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that here you expect that the path is a string b58 encoded multihash, while... ->
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct thing to do is to check for the bs58-encoded value. If you're seeing anything else it's definitely an error to accommodate pre-this-PR. Thanks for noticing.
There are some
Adding CI now |
@noffle got ipfs-inactive/js-ipfs-http-client#296 (comment), which makes me think something is weird with js-ipfs since it doesn't error. |
6ae5088
to
e656e7c
Compare
The multihash buffer vs bs58-encoded string is an old breakage; forgot to push the fix. This was what I addressed in js-ipfs-unixfs-engine a while back. Update: worse! Somehow my commits got merged twice on this branch -- what a mess. I went back and re-rebased my way to a much cleaner state. Tests pass now for me, commits are squashed, linting is done! 👌 |
|
||
module.exports = (common) => { | ||
describe('.files', () => { | ||
describe.only('.files', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to change this. But I can also do it on merge :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agh, I'm guilty of continually doing this. Will correct. :)
Thank you! I got an error in js-ipfs-api browser tests though, see: https://github.com/ipfs/js-ipfs-api/pull/296/files#r73787506 Also, in js-ipfs, I'm now getting:
|
@@ -20,6 +20,7 @@ | |||
- [Files](/API/files) | |||
- [`add`](/API/files#add) | |||
- [`createAddStream`](/files#createaddstream) | |||
- [`get`](/API/files#get) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@noffle seems that this was never added to the files.md. Maybe a missing commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure where it got dropped. Thanks for noticing! I'll re-add.
Closing this in favour of #54. |
ipfs.files.get
implementation (Add files.get command and tests js-ipfs-http-client#296)