Skip to content
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

Move the ClientAfter calls to before the decode #1008

Merged
merged 2 commits into from Sep 4, 2020

Conversation

directionless
Copy link
Contributor

@directionless directionless commented Aug 26, 2020

ClientAfter is documented as running prior to being decoded. But, this
was only partly true. They were run prior to decode, but after the
jsonrpc unmarshalling,

As the callback uses the bare response object, and at least for me, is
used to debug what's seen on the wire, this seems incorrect.

This oddity does not exist in other transports, as there is not the duplicate decode step.

ClientAfter is documented as running _prior_ to being decoded. But, this
was only partly true. They were run prior to decode, but after the
jsonrpc unmarshalling,

As the callback uses the bare response object, and at least for me, is
used to debug what's seen on the wire, this seems incorrect.
@peterbourgon
Copy link
Member

peterbourgon commented Aug 26, 2020

Sounds good. Can you add a test which fails before this change and succeeds afterwards?

@directionless
Copy link
Contributor Author

directionless commented Aug 29, 2020

Okay! I added tests.

Also did some cleanup on that test file:

  • Removed the external network calls
  • added various Close() and Parallel() calls
  • moved some of the wrappers into a table driven test

@directionless
Copy link
Contributor Author

directionless commented Sep 4, 2020

Hi! I wanted to check in on this?

@peterbourgon
Copy link
Member

peterbourgon commented Sep 4, 2020

Apologies for the delay. Looks good. Thanks!

@peterbourgon peterbourgon merged commit 6860cdd into go-kit:master Sep 4, 2020
2 checks passed
@sagikazarmark sagikazarmark added this to the v0.11.0 milestone Jun 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants