-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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(grpcrouter): add hybrid query handler #17921
Conversation
baseapp/protocompat/protocompat.go
Outdated
return nil, fmt.Errorf("invalid request type %T, method %s does not accept gogoproto messages", request, prefMethod.FullName()) | ||
} | ||
resp, err := method.Handler(handler, ctx, func(msg any) error { | ||
proto2.Merge(msg.(proto2.Message), protov2Request) |
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 are we merging?
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'm not sure what other alternative we have besides doing reflect.Set, which I'm not really happy doing post app initialization.
@testinginprod your pull request is missing a changelog! |
protov2Type = reflect.TypeOf((*proto2.Message)(nil)).Elem() | ||
) | ||
|
||
type Handler = func(ctx context.Context, message protoiface.MessageV1) (protoiface.MessageV1, error) |
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.
type Handler = func(ctx context.Context, message protoiface.MessageV1) (protoiface.MessageV1, error) | |
type Handler = func(ctx context.Context, request, response protoiface.MessageV1) error |
We discussed changing to this signature in our last call. Strongly recommend this because it matches the signature of ClientConnInterface.Invoke
. The signature that this PR has can be a wrapper that looks up the response type, but generally there should be no need to look up the response type because Invoke
will provide it.
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.
If we follow this API we'd need to merge on the resp also
@Mergifyio backport release/v0.50.x |
✅ Backports have been created
|
Co-authored-by: unknown unknown <unknown@unknown> (cherry picked from commit ecf14b7)
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
make lint
andmake test
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change