-
-
Notifications
You must be signed in to change notification settings - Fork 564
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 a few streaming interceptor bugs #3655
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- The wrap function for server interceptors was working as if it were a client interceptor: expecting the stream to be the result of calling the endpoint or the next unary interceptor in the chain. It now properly wraps the stream in the raw payload (which is actually a special `EndpointStruct` with the stream and optionally the unary payload). - The unary `Payload` methods of server interceptor info structs for a streaming method assumed that the raw payload would be the payload type rather than the special `EndpointStruct` type. Now, the `Payload` methods properly expect the raw payload to either be the `EndpointStruct` or the payload type in the case when the server interceptor info struct is also used for a client interceptor.
douglaswth
added a commit
to goadesign/examples
that referenced
this pull request
Feb 18, 2025
douglaswth
added a commit
to goadesign/clue
that referenced
this pull request
Feb 18, 2025
I've found one more bug to fix which I'll push here. |
- With the change of `goa.InterceptorInfo` from a struct to an interface, the generation of implementation of the interface methods on the generated interceptor info structs became necessary. The code for those methods was included in a section of the template that was conditional on the interceptor having accessors. Now, the conditional has been moved to a more appropriate place so the interface methods are implemented.
This is great, thank you! |
raphael
added a commit
to goadesign/examples
that referenced
this pull request
Feb 22, 2025
* Add interceptors example * go mod tidy * Improve interceptors example README * Progress on streaming interceptors in example which uncovered a generation bug * Fix Goa generation with goadesign/goa#3652 * Generate with interceptor fixes from goadesign/goa#3655 --------- Co-authored-by: Douglas Thrift <[email protected]>
raphael
pushed a commit
to goadesign/clue
that referenced
this pull request
Feb 22, 2025
…520) * Add interceptors package with useful typed Goa interceptor functions - Add Trace Stream family of interceptor functions which allow for tracing of individual messages sent on bidirectional, client to server, and server to client streams. - Fix typos in several READMEs. [ ] Add tests for the interceptor functions. * Retrieve receive context via context rendezvous since we decided against changing the Goa interceptor interface to return a context * Add embeddable structs for interceptors as more terse option (only somewhat since Go needs more explicit type parameters than it should) * Add tests for the Trace Stream interceptors and wrappers * Improve naming with input from @xeger * Point to Goa with interceptor fixes from goadesign/goa#3655
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
EndpointStruct
with the stream and optionally the unary payload).Payload
methods of server interceptor info structs for a streaming method assumed that the raw payload would be the payload type rather than the specialEndpointStruct
type. Now, thePayload
methods properly expect the raw payload to either be theEndpointStruct
or the payload type in the case when the server interceptor info struct is also used for a client interceptor.goa.InterceptorInfo
from a struct to an interface, the generation of implementation of the interface methods on the generated interceptor info structs became necessary. The code for those methods was included in a section of the template that was conditional on the interceptor having accessors. Now, the conditional has been moved to a more appropriate place so the interface methods are implemented.