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

Header work #128

Merged
merged 2 commits into from
Nov 21, 2015
Merged

Header work #128

merged 2 commits into from
Nov 21, 2015

Conversation

dignifiedquire
Copy link
Contributor

Goal: Fix #76 still not there though..

When ipfs/kubo#1979 is merged we can remove the config settings in the daemon setup

try {
parsed.push(JSON.parse(chunk))
} catch (err) {
// Browser quirks emit more than needed sometimes
Copy link
Contributor

Choose a reason for hiding this comment

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

Emit more than needed? What does this exactly mean? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you have 3 chunks, you sometimes get:

  • chunk1
  • chunk2
  • chunk3
  • chunk1+chunk2 => not parsable

do not ask me why, browsers are a weird bunch..

Copy link
Contributor

Choose a reason for hiding this comment

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

What I'm thinking is that "stream" and "chunked" should not exist at the same time. "chunked" is a stream made of small parts of the same files, they should not be parsed individually. "stream" in the another hand, it is the ndjson stuff :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, but "chunked" is represented as a (node) stream where each individual emitted event is equal to one chunk, that's why we are parsing it this way

@daviddias
Copy link
Contributor

LGTM :)

dignifiedquire added a commit that referenced this pull request Nov 21, 2015
@dignifiedquire dignifiedquire merged commit 59c84e7 into ipfs-inactive:master Nov 21, 2015
@dignifiedquire dignifiedquire deleted the headers branch November 21, 2015 11:53
@dignifiedquire dignifiedquire mentioned this pull request Nov 23, 2015
53 tasks
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.

2 participants