-
Notifications
You must be signed in to change notification settings - Fork 299
fix(get): properly handled nested content #384
Conversation
}) | ||
next() | ||
ex.on('entry', (header, stream, next) => { | ||
stream.on('end', next) |
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.
This means that now, one file has to finish in order for us to 'receive' the next. Not sure how this is an improvement, the previous version was pushing a readable stream that gets filled as soon as we know the file exists.
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.
This has to happen already if you read the documentation of tar-stream. This only makes sure that we actually process things correctly. The current implementation throws up and dies on larger sets of 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.
Checking https://www.npmjs.com/package/tar-stream#extracting, it only says that "next" will emit the next entry, that being said, I should be able to get a readable stream for all the files within the tar first and then consume them.
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.
@diasdavid you missed this part:
The tar archive is streamed sequentially, meaning you must drain each entry's stream as you get them or else the main extract stream will receive backpressure and stop reading.
|
Yes they can't finish, because they do not drain the content of the file for each received item, instead they try to do I suggest changing the interface-ipfs-core tests accordingly for now, as the current version is broken for everything with multiple files and the alternative is writing our own tar extractor. |
@dignifiedquire I'm understanding what you mean, however, something is off because these tests were passing before, which means that calling |
@diasdavid we still need to figure this one out |
1738939
to
57796ad
Compare
57796ad
to
0731f45
Compare
Ref ipfs/js-ipfs#498
Needs ipfs-inactive/interface-js-ipfs-core#88