-
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
feat: add ErrNotFound #494
base: master
Are you sure you want to change the base?
Conversation
07c5309
to
7b069ee
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.
Joy 🎉 thank you
This is a BREAKING CHANGE as it no longer strictly matches only this ErrNotFound type but any type implementing interface{ NotFound() bool }. Ref: ipld/go-ipld-prime#494
This is a BREAKING CHANGE as it no longer strictly matches only this ErrNotFound type but any type implementing interface{ NotFound() bool }. Ref: ipld/go-ipld-prime#494
go-ipld-format version of this ipfs/go-ipld-format#76 |
@masih @willscott: continuing discussion from https://github.com/ipfs/go-ipld-format/pull/76/files#r1108834553, I've implemented the change discussed here first and will copy wholesale over there afterward. The main goal is to make But, the annoying challenge with this is that So what I've also done is changed Thoughts? |
As long as we have a recommendation between the two in comments on the two function, i think it's fine to move forward here |
d5ef532
to
eee16ca
Compare
This is a BREAKING CHANGE as it no longer strictly matches only this ErrNotFound type but any type implementing interface{ NotFound() bool }. Ref: ipld/go-ipld-prime#494
Slight change of approach here - instead of using a |
* Intended to replace github.com/ipfs/go-ipld-format#ErrNotFound * A new IsNotFound() that uses feature detection rather than type checking so it's compatible with old and new forms. Ref: ipld/go-car#363 Ref: #493
ABI compatible with github.com/ipfs/go-ipld-format#ErrNotFound for smoother upgrade path
Ref: ipld/go-car#363
Ref: #493
I flagged this in the go-car PR where I put a form of this in v2/storage, which has a note about potentially doing this here: https://github.com/ipld/go-car/blob/a2a8d2f9f60fba6cb0c0b985d9599bcc03a3e2f4/v2/storage/notfound.go#L5-L8
@hannahhoward has flagged the need for this in #493 since it's getting increasingly awkward when moving between LinkSystem and Blockstore and back again, as demonstrated in filecoin-project/lassie#86.
Unfortunately, in its current form, we can't just make the "legacy"
ErrNotFound
be an alias for this one because I'm using aKey
property here rather thanCid
, because the storage interfaces here are allkey string
based. https://github.com/ipfs/go-ipld-format/blob/e379dec580e9a158eaa5311f6cf6ab644c0b3ca2/merkledag.go#L15Instead, my proposal for now is to just update the
IsNotFound()
over there to match this one, so it feature-detects too and they can play nicely together. We could also put a deprectation notice on it and point people here.Other suggestions?