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

fix: do not stringify output of object data #1398

Merged
merged 1 commit into from
Jun 19, 2018
Merged

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Jun 14, 2018

Without this change:

$ jsipfs object data `dd if=/dev/urandom bs=307200 count=1 | jsipfs files write --create /some-file && jsipfs files stat -h /some-file` | unixfs
{"type":"file","blockSizes":[72481833443311,10909182287855]}

e.g.

00000000: 0802 18ef bfbd efbf bd12 20ef bfbd efbf  .......... .....
00000010: bd10 20ef bfbd efbf bd02                 .. .......

With this change:

$ jsipfs object data `dd if=/dev/urandom bs=307200 count=1 | jsipfs files write --create /some-file && jsipfs files stat -h /some-file` | unixfs
{"type":"file","blockSizes":[262144,45056]}

e.g.

00000000: 0802 1880 e012 2080 8010 2080 e002       ...... ... ...

Stringifying the data changes it's encoding. Been banging my head against this all morning.

Copy link
Member

@daviddias daviddias left a comment

Choose a reason for hiding this comment

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

CI is really sad. Checking it quickly seems that something went bad on unixfs-engine.

@achingbrain
Copy link
Member Author

Weird that the tests were passing on Circle but exploding in a fairly dramatic fashion on Jenkins. 🤷‍♂️

A rebase and it's all looking good.

@alanshaw
Copy link
Member

Does this need a "BREAKING CHANGE" section in the commit message or should this be considered a bug fix? Is not a chore?!

@victorb
Copy link
Member

victorb commented Jun 19, 2018

Weird that the tests were passing on Circle but exploding in a fairly dramatic fashion on Jenkins

Indeed. Could be because of the aggressive caching Circle does of the dependencies.

@achingbrain
Copy link
Member Author

Does this need a "BREAKING CHANGE" section in the commit message

I don't think so, we're not changing an API or interface so it shouldn't break anything, quite the opposite.

Should this be considered a bug fix? Is not a chore?!

It feels like a chore. Just kidding, would you like me to change the commit message?

@alanshaw
Copy link
Member

chores don't make it into the auto generated changelog, if you don't mind changing to fix that would be brill

Without this change:

```sh
$ jsipfs object data `dd if=/dev/urandom bs=307200 count=1 | jsipfs files write --create /some-file && jsipfs files ls -h /some-file` | unixfs
{"type":"file","blockSizes":[72481833443311,10909182287855]}
```

e.g.

```
00000000: 0802 18ef bfbd efbf bd12 20ef bfbd efbf  .......... .....
00000010: bd10 20ef bfbd efbf bd02                 .. .......
```

With this change:

```sh
$ jsipfs object data `dd if=/dev/urandom bs=307200 count=1 | jsipfs files write --create /some-file && jsipfs files ls -h /some-file` | unixfs
{"type":"file","blockSizes":[262144,45056]}
```

e.g.

```
00000000: 0802 1880 e012 2080 8010 2080 e002       ...... ... ...
```

Stringifying the data changes it's encoding. Been banging my head against this all morning.
@achingbrain
Copy link
Member Author

chores don't make it into the auto generated changelog

Fair enough, have updated the commit message.

@achingbrain achingbrain changed the title chore: do not stringify output of object data fix: do not stringify output of object data Jun 19, 2018
@achingbrain achingbrain merged commit 4e51a69 into master Jun 19, 2018
@ghost ghost removed the status/in-progress In progress label Jun 19, 2018
@achingbrain achingbrain deleted the print-raw-data branch June 19, 2018 13:58
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.

4 participants