-
Notifications
You must be signed in to change notification settings - Fork 900
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(share/getter): add support for ErrNotFound in shrex getter implementation #2073
Conversation
- add support in ipld getter - add support in store getter
|
||
fmt.Println(car.HeaderSize(carReader.Header)) |
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.
just a sneaky cleanup. Didn't want to make an extra PR for that
// validate will collect peer.ID into corresponding peer pool | ||
func (m *Manager) validate(_ context.Context, peerID peer.ID, msg shrexsub.Notification) pubsub.ValidationResult { | ||
// Validate will collect peer.ID into corresponding peer pool | ||
func (m *Manager) Validate(_ context.Context, peerID peer.ID, msg shrexsub.Notification) pubsub.ValidationResult { |
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.
Exported to allow adding peers in tests. Not super clean solution, I'm open for other suggestions how to populate peer manager with test peers.
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.
Fine to me, as long as we consider migrating over to messenger in short term, which will fix this
7ddb7d7
to
9335ff1
Compare
share/getters/shrex.go
Outdated
case p2p.ErrInvalidResponse: | ||
case errors.Is(getErr, context.DeadlineExceeded), | ||
errors.Is(getErr, context.Canceled): | ||
case errors.Is(getErr, p2p.ErrUnavailable): |
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.
Why is it called unavailable?
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.
We've had this discussion before - its unavailable because it means we don't have it at the moment (but may have it in a few seconds)
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.
I've renamed it to ErrNotFound to make it consistent to other errs in out codebase.
For some reason this one doesn't track pushes to the source branch anymore. Closing in favour of new one #2074 |
Overview
Resolves #2037