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

Rename "stream" to "content" in tuples. #43

Merged
merged 6 commits into from
May 26, 2016

Conversation

hackergrrl
Copy link
Contributor

No description provided.

@daviddias
Copy link
Contributor

Why?

@hackergrrl
Copy link
Contributor Author

hackergrrl commented May 24, 2016

@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.

@daviddias
Copy link
Contributor

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.

@hackergrrl
Copy link
Contributor Author

hackergrrl commented May 25, 2016

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'
Copy link
Contributor

Choose a reason for hiding this comment

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

@nginnever
Copy link
Contributor

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".
@hackergrrl hackergrrl force-pushed the stream-to-content branch from 6aa98db to 462d2f4 Compare May 25, 2016 23:36
@hackergrrl
Copy link
Contributor Author

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 this.push(null) until all of the entries have been added (successfully or not) to the DAG Service.

if (err) {
this.push({error: 'failed to store dirNode'})
} else if (base) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this base ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@daviddias
Copy link
Contributor

daviddias commented May 26, 2016

  • readme needs to be updated to inform the possibility of using Buffers now

@@ -29,6 +29,17 @@ module.exports = function (repo) {
done()
})

it('bad input', (done) => {
Copy link
Contributor

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) ? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hackergrrl
Copy link
Contributor Author

hackergrrl commented May 26, 2016 via email

@daviddias daviddias merged commit f8fe961 into ipfs-inactive:master May 26, 2016
@daviddias
Copy link
Contributor

going to release a minor version, can you then update js-ipfs?

@hackergrrl
Copy link
Contributor Author

hackergrrl commented May 27, 2016

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". :'(

@daviddias
Copy link
Contributor

daviddias commented May 27, 2016

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.

@hackergrrl
Copy link
Contributor Author

@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.

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.

3 participants