Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

update/files add interface #306

Merged
merged 7 commits into from
Jun 6, 2016
Merged

Conversation

daviddias
Copy link
Member

Builds on #261

@jbenet jbenet added the status/in-progress In progress label Jun 5, 2016
@@ -36,7 +36,7 @@ module.exports = Command.extend({
throw (err)
}
res.on('data', (data) => {
data.stream.pipe(process.stdout)
data.content.pipe(process.stdout)
})
Copy link
Member Author

@daviddias daviddias Jun 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be changed to make res the stream instead, once we have the interface-ipfs-core for cat merged too

//cc @nginnever

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, changes to make cat return just a stream are in PR 256

@daviddias daviddias force-pushed the update/files-add-interface branch 2 times, most recently from ea0eb40 to 9bb79f6 Compare June 6, 2016 14:59
@daviddias
Copy link
Member Author

# https://travis-ci.org/ipfs/js-ipfs/jobs/135623124#L4500-L4504
Uncaught AssertionError: expected 'QmZ25UfTqXGz9RsEJFg7HUAuBcmfx5dQZDXQd2QEZ8Kj74' to equal 'QmVvjDy7yF7hdnqE8Hrf4MHo5ABDtb5AbX6hWbD3Y42bXP'
      + expected - actual
      -QmZ25UfTqXGz9RsEJFg7HUAuBcmfx5dQZDXQd2QEZ8Kj74

@noffle you mentioned that you had seen this behaviour before and fixed it. Thoughts?

@hackergrrl
Copy link
Contributor

@diasdavid the linked test is showing as green to me. Still a problem?

if (counter === 0) {
ds.push(null)
} else {
setTimeout(canFinish, 100)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this 100ms timeout loop?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cause getting the object is an Async operation and the underlying stream from the importer won't care to wait that we have pushed all the objects to the upper stream and emit them all and then the 'end' event. This avoid a racing condition.

@dignifiedquire dignifiedquire merged commit bf56200 into master Jun 6, 2016
@dignifiedquire dignifiedquire deleted the update/files-add-interface branch June 6, 2016 18:27
@jbenet jbenet removed the status/in-progress In progress label Jun 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants