-
Notifications
You must be signed in to change notification settings - Fork 50
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
Cid.Undef IPLD de-serialization error #246
Comments
🤯
so yeah, this should probably be interpreted as OR, just error earlier, or with a more informative message to discourage use of |
Note that part of this duality is because of the quirk in how we represent |
#196 possibly helps with this? |
Revisiting this, I think maybe our codecs need to special-case this and convert to |
Otherwise we end up with invalid output. dag-cbor: 0xd82a4100 d8 2a # tag(42) 41 # bytes(1) 00 # "\x00" dag-json: {"/":"b"} Fixes: #246
Otherwise we end up with invalid output. dag-cbor: 0xd82a4100 d8 2a # tag(42) 41 # bytes(1) 00 # "\x00" dag-json: {"/":"b"} Fixes: #246
Otherwise we end up with invalid output. dag-cbor: 0xd82a4100 d8 2a # tag(42) 41 # bytes(1) 00 # "\x00" dag-json: {"/":"b"} Fixes: #246
Otherwise we end up with invalid output. dag-cbor: 0xd82a4100 d8 2a # tag(42) 41 # bytes(1) 00 # "\x00" dag-json: {"/":"b"} Fixes: #246
If we use
cid.Undef
to create a newdatamodel.Link
withcidLink
, it is serialized as"/": "b"
, which means that when trying to de-serialize it, we getcid is too short
. I don't think we should error in this case. We should probably not serializecid.Undef
, or use aNull
type, to allow de-serialization in the other end. I don't know if this the expected behavior we wanted forcid.Undef
or it is open to discussion.Background
I was serializing an IPLD node map with a bunch of links, some of them were
cid.Undef
, and I was gettingcid is too short
. I was blaming the Links which were actually set, when in the end it was thecid.Undef
the one to blame.The text was updated successfully, but these errors were encountered: