This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
chore: move mfs and multipart files into core #2811
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 tasks
achingbrain
force-pushed
the
refactor/merge-mfs-into-core
branch
from
March 13, 2020 20:19
e80d841
to
864ab81
Compare
feat: streaming http requests No more 4GB file limits.
achingbrain
force-pushed
the
refactor/merge-mfs-into-core
branch
from
March 13, 2020 20:29
864ab81
to
28fea6a
Compare
BREAKING CHANGE: When the path passed to `ipfs.files.stat(path)` was a hamt sharded dir, the resovled value returned by js-ipfs previously had a `type` property of with a value of `'hamt-sharded-directory'`. To bring it in line with go-ipfs this value is now `'directory'`.
achingbrain
changed the title
chore: move mfs files into core
chore: move mfs and multipart files into core
Mar 17, 2020
hugomrdias
suggested changes
Mar 18, 2020
packages/ipfs-utils/src/http.js
Outdated
Comment on lines
126
to
137
let bodyErr | ||
|
||
if (opts.body && (opts.body.on || opts.body.addEventListener)) { | ||
const on = (opts.body.on || opts.body.addEventListener).bind(opts.body) | ||
|
||
// TODO: not sure this will work after the high water mark is hit and the request | ||
// starts streaming | ||
on('error', (err) => { | ||
bodyErr = err | ||
}) | ||
} | ||
|
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.
can you explain why we need this ?
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.
If the body is a stream, and that stream errors the error is not surfaced to the calling code.
This will throw any error thrown until the response headers arrive. I'm not sure if we should keep it TBH as it stops working once the response headers have been received, after that any error is smothered, same as without the bodyErr
lines in the PR.
It makes this test pass (http://localhost:3000 is an echo server):
it('should handle errors in streaming bodies', async function () {
const err = new Error('Should be caught')
const body = async function * () {
yield Buffer.from([0, 1, 2])
// await delay(1000) <-- uncomment this line and the test fails as the
// response headers arrive before err is thrown
throw err
}()
await expect(HTTP.post('http://localhost:3000', {
body: toStream.readable(body)
})).to.eventually.be.rejectedWith(err)
})
hugomrdias
approved these changes
Mar 18, 2020
hugomrdias
approved these changes
Mar 18, 2020
mistakia
pushed a commit
to mistakia/js-ipfs
that referenced
this pull request
Mar 22, 2020
BREAKING CHANGE: When the path passed to `ipfs.files.stat(path)` was a hamt sharded dir, the resovled value returned by js-ipfs previously had a `type` property of with a value of `'hamt-sharded-directory'`. To bring it in line with go-ipfs this value is now `'directory'`.
SgtPooki
referenced
this pull request
in ipfs/js-kubo-rpc-client
Aug 18, 2022
BREAKING CHANGE: When the path passed to `ipfs.files.stat(path)` was a hamt sharded dir, the resovled value returned by js-ipfs previously had a `type` property of with a value of `'hamt-sharded-directory'`. To bring it in line with go-ipfs this value is now `'directory'`.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've converted the mfs tests to interface tests and they are a lot more thorough than the previous ones.
Turns out a whole bunch of stuff didn't work over http. Also, some of our interface tests now make go-ipfs fail, mostly around mfs operations on hamt shards - removing files from shards in particular. I've skipped all of these tests when we run against go-ipfs but we'll need some follow up issues.
BREAKING CHANGES:
ipfs.files.stat(path)
run on a hamt sharded directory used to report atype
ofhamt-sharded-directory
, now it reportsdirectory
to bring js-ipfs in line with go-ipfs.