-
Notifications
You must be signed in to change notification settings - Fork 52
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
fix: use slash as flag that an object is a CID #217
Conversation
As per #212 making `asCID` enumerable breaks tests where modules don't handle self-referential data properly. As proposed in #213 this swaps `cid.CID === cid` for `cid['/'] === cid.bytes` as a mechanism to tell consumers that the object in question is a `CID` which lets them write CBOR with the correct tags, for example. Fixes #212 Closes #213
0f19b43
to
e40defc
Compare
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.
works for me (although I'm being slowly worn down over these and it's a bit disheartening to see all of the historical compatibility cruft building up in these)
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.
Provided some feedback on this PR. With those comments addressed, I'm fine with these changes. That said I would prefer to spend a bit more time discussing / considering alternatives.
sender.close() | ||
receiver.close() | ||
assert.strictEqual(cid2['/'], cid2.bytes) |
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.
Moved the assertion to the end so if it fails, we still shut the message channel down and the process doesn't hang forever.
@Gozala all done I think! |
## [10.0.2](v10.0.1...v10.0.2) (2022-10-19) ### Bug Fixes * use slash as flag that an object is a CID ([#217](#217)) ([1cec619](1cec619)), closes [#212](#212) [#213](#213) ### Trivial Changes * **no-release:** rename varint test file so it is run ([#209](#209)) ([e32fe47](e32fe47)) * remove unnecessary dev deps ([#218](#218)) ([a43ffff](a43ffff))
🎉 This PR is included in version 10.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
As per #212 making
asCID
enumerable breaks tests where modules don't handle self-referential data properly.As proposed in #213 this swaps
cid.CID === cid
forcid['/'] === cid.bytes
as a mechanism to tell consumers that the object in question is aCID
which lets them write CBOR with the correct tags, for example.Fixes #212
Closes #213