Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make mimetype optional as it is in go #24

Merged
merged 1 commit into from
Jun 4, 2018

Conversation

achingbrain
Copy link
Member

The mimetype is optional in go-ipfs-unixfs so this PR makes it optional in js too.

Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

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

This LGTM in that I can verify they both now have an optional MimeType.

Is this a breaking change?

Am I right in saying that this change will not affect anything to do with existing content (and would actually allow js-ipfs to deserialise content that has been created in go land without a MimeType?) but new content would get a different hash that it would have previously?

@@ -20,5 +20,5 @@ module.exports = `message Data {
}

message Metadata {
required string MimeType = 1;
optional string MimeType = 1;
Copy link
Member

Choose a reason for hiding this comment

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

This means that go-ipfs changed meanwhile. It would be great to have unixfs spec'ed out //cc @whyrusleeping @Stebalien

Copy link
Member

Choose a reason for hiding this comment

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

for reference: ipfs/kubo#3458

tldr; DONT USE REQUIRED

@daviddias
Copy link
Member

@achingbrain can you answer @alanshaw's questions? If all is good, go ahead for the merge and release :)

@achingbrain
Copy link
Member Author

Is this a breaking change?

I don't think so, no - previous hashes would continue to work but anything newly hashed that didn't have a MimeType property for it's meta data would get a different hash than previously.

Am I right in saying that this change will not affect anything to do with existing content (and would actually allow js-ipfs to deserialise content that has been created in go land without a MimeType?) but new content would get a different hash that it would have previously?

Yes, exactly.

@daviddias
Copy link
Member

@achingbrain gave you publish perms (seems that npm stopped having problems today)

@achingbrain achingbrain merged commit 4e17880 into master Jun 4, 2018
@ghost ghost removed the status/in-progress In progress label Jun 4, 2018
@achingbrain achingbrain deleted the make-mimetype-optional branch June 4, 2018 09:51
achingbrain added a commit that referenced this pull request Feb 19, 2020
* feat: switch to async await

* chore: update ipld formats

* chore: update README

* chore: standardise error codes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants