-
Notifications
You must be signed in to change notification settings - Fork 20
Rename "stream" to "content" in tuples. #43
Conversation
Why? |
@diasdavid see ipfs-inactive/interface-js-ipfs-core#20 (comment) We could just translate everywhere, but so little deps on this module so there's no impact to changing it here. |
Well, in js-ipfs, content can be a Buffer or a Stream, here has to be a stream, so yes, you need to translate it if it is a Buffer. |
Ah, I see now! Understood: I'll add that here in another commit. Good catch! |
@@ -29,6 +29,17 @@ module.exports = function (repo) { | |||
done() | |||
}) | |||
|
|||
it('bad input', (done) => { | |||
const r = 'banana' |
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.
Buffer support in the importer LGTM! |
Previously it would be possible for certain writes to the DAG Service to occur *after* the stream had ended, meaning the Importer would return objects that did not yet exist in the DAG Service. This change defers stream termination until after those writes have occurred, to preserve the powerful invariant of "element emission => written to dag service".
6aa98db
to
462d2f4
Compare
Expanded this PR just a little bit more: I noticed that the Importer's Transform stream would often close before all of its nodes had been written to the DAG Service. So this includes a tweak to hold off on the |
if (err) { | ||
this.push({error: 'failed to store dirNode'}) | ||
} else if (base) { |
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.
what is this base
?
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.
|
@@ -29,6 +29,17 @@ module.exports = function (repo) { | |||
done() | |||
}) | |||
|
|||
it('bad input', (done) => { |
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.
what about a good banana (inside a buffer) ? :)
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.
Good call -- done!
|
going to release a minor version, can you then update js-ipfs? |
js-ipfs: I need to get my interface-ipfs-core changes done first. Version: are we ready for 1.0.0 now for this module? Merging: in the future, can we wait until I say "ready for merge"? This ended up merging commits like "wip; squash me". :'( |
We can't do version 1.0.0 until we have the sharding in place. On the squashing: 👍 agree - Can we also as a best practice squash and rebase our commits as we go? I've been doing that, not sure if you agree, but since it is to happen anyway. |
@diasdavid I have been doing this, but once and I while I miss some, so I like it when I have that chance to review my commits before the maintainer merges. |
No description provided.