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

files.add incorrectly calls importer function #150

Closed
vijayee opened this issue Apr 15, 2016 · 3 comments
Closed

files.add incorrectly calls importer function #150

vijayee opened this issue Apr 15, 2016 · 3 comments

Comments

@vijayee
Copy link

vijayee commented Apr 15, 2016

The call is erroneous:
https://github.com/ipfs/js-ipfs/blob/master/src/core/index.js#L337-L341
when compared to:
https://github.com/ipfs/js-ipfs-data-importing/blob/master/src/index.js#L18
it should be:

this.files = {
    add: (path, options, callback) => {
      importer(path, dagS, options, callback)
    }
  }

will pr later to fix

@nginnever
Copy link
Member

nginnever commented Apr 15, 2016

Hey vijayee!

This was noticed by @bgrieder as well and he created a PR already which opened up a whole can of discussion, mostly about data-exporting which I am currently working on . Ultimately we will want to restructure the way data-importing is done as well to match things like sharding in go-ipfs. There has also been an idea from @diasdavid to extract the FS things out of the importer and make the importer only take in streams.

@daviddias
Copy link
Member

There has also been an idea from @diasdavid to extract the FS things out of the importer and make the importer only take in streams.

I wouldn't call it an 'idea', it is the plan :) ipfs-core shouldn't have to handle fs directly if used programatically. The file streams will come through the http-api, just like go-ipfs handles it.

@daviddias
Copy link
Member

Seems that this is fixed now, thank you for reporting :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants