-
Notifications
You must be signed in to change notification settings - Fork 299
Conversation
Passes the progress bar option for tranfers over http. Progress is shown for your payload being streamed upto the server. There is a pause. Then you get your list of files.
* support support specify hash alg * Add test for add with --hash option. Pass raw cid/multihash to ipfs object get/data * Allow object get/data to accept CID * Var naming tweaks from review
pinging @skzap. This supports the |
789d8aa
to
4eb42f4
Compare
Codecov Report
@@ Coverage Diff @@
## master #604 +/- ##
=========================================
+ Coverage 83.08% 83.4% +0.31%
=========================================
Files 106 107 +1
Lines 1460 1482 +22
=========================================
+ Hits 1213 1236 +23
+ Misses 247 246 -1
Continue to review full report at Codecov.
|
4eb42f4
to
78c6d0f
Compare
78c6d0f
to
10b0bde
Compare
Seems like firefox is timing out on travis, can someone with write access rerun the build? |
@@ -13,7 +13,7 @@ | |||
"devDependencies": { | |||
"babel-core": "^5.4.7", | |||
"babel-loader": "^5.1.2", | |||
"ipfs-api": "^12.1.7", | |||
"ipfs-api": "../../", |
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.
Hm... 🤔
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.
That's an example in the examples directory. Just repointed it to use the current ipfs-api rather than a published version.
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.
Thanks, now it makes sense 👍
test/files.spec.js
Outdated
expect(err).to.not.exist() | ||
|
||
expect(res).to.have.length(1) | ||
expect(progress).to.be.greaterThan(0) |
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.
Should exactly be 100 right?
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.
agreed with @victorbjelkholm
@dryajov have you tried using this with js-ipfs and see if it works for the CLI? |
test/files.spec.js
Outdated
expect(err).to.not.exist() | ||
|
||
expect(res).to.have.length(1) | ||
expect(progress).to.be.greaterThan(0) |
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.
agreed with @victorbjelkholm
test/files.spec.js
Outdated
|
||
expect(res).to.have.length(1) | ||
expect(progress).to.be.equal(100) | ||
expect(progressCount).to.be.greaterThan(0) |
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.
Should not have to use greaterThan
here. We should know how many times progressHandler
is being called, and assert on that exactness. Not "something something above 0".
@dryajov just checked and the value being returned is always
Which means that go-ipfs returns an in progress, but it is not clear what this number is. Also, this feature needs to be tested with bigger files, directories and be documented. In order to push this forward, we need:
@dryajov up to finish this PR? |
Sure thing - I can finish this. |
@diasdavid The cli works with - ipfs/js-ipfs#994 |
I just checked the core tests - I know what this means now |
Added interface tests - ipfs-inactive/interface-js-ipfs-core#155 |
Re: documenting feature - the docs for
|
update - I believe I have all the todos covered, except the I can run the js-ipfs manually and it works, but the tests are for some reason not picking up the flag, or something else is going on - I get no progress output in stdout. |
Thanks for pushing this, @dryajov. See review on ipfs-inactive/interface-js-ipfs-core#155. Also, you skipped updating the docs. |
@diasdavid RE docs: #604 (comment) This is what I'm talking about - the docs just link to the
|
@dryajov good catch. That is confusing for users though. Do you mind pulling those supported options to the API doc? |
@dryajov what about calling the callback with the error? |
the problem is that the callback was already called, the only thing thats left is the stream and the through processors :( I somehow need to make that error propagate all the way to - https://github.com/ipfs/js-ipfs-api/blob/10b0bde35a2dc106b93d52057b91265cb73a4614/src/files/add.js#L50 where that |
c01db10
to
1891bbf
Compare
docs have also been updated in - https://github.com/ipfs/interface-ipfs-core/pull/155/files#diff-d1498a38c27c6500d8aa28946eca0d2cR29 |
This issue is ready to ship. However, the changes in ipfs/js-ipfs#1036, currently prevent propagating errors correctly, fortunately, this should be extremely rare/catastrophic errors, i.e. out of disk space on the remote ipfs node. In order to get this working, some reworking of how responses are processed might be required, I'll open a separate issue to track that effort, but we should not hold this issues because of it. |
@dryajov tests fail locally:
Am I missing something? |
There appears to be weirdness with how go-ipfs reports progress.
Here is some quick output I added to the test to track file sizes being acumulted and how they are being reported on upload.
|
const ipfs = ipfsAPI('/ip4/127.0.0.1/tcp/6001') | ||
/* eslint-disable */ | ||
ipfs.files.add(Buffer.from('Hello there!'), (err, res) => { | ||
// TODO: error's are not being correctly |
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.
@dryajov track this in an issue.
Adding this as we need this ASAP, should address #596 (comment)