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

Fix meta serialization #159

Merged
merged 3 commits into from
May 17, 2024
Merged

Fix meta serialization #159

merged 3 commits into from
May 17, 2024

Conversation

sagikazarmark
Copy link
Member

Overview

Fix spec violation reported in #158

What this PR does / why we need it

Fixes #158

@sagikazarmark sagikazarmark force-pushed the fix-meta-serialization branch from 43f1f43 to c08d0ad Compare May 16, 2024 11:59
@sagikazarmark
Copy link
Member Author

@ManInTheBox could you maybe try this fix in your environment?

@ManInTheBox
Copy link

Sure, will give give it a try and will let you know.

@ManInTheBox
Copy link

Thanks Márk, I just tested this fix and it worked fine for me! There's only one potential caveat as you've said

The important thing is that clients can interpret what's traveling over the wire.

which could be a problem with regular proto messages, but in the case of an error, the clients usually receive and interpret the errors right away from the server (request/response) so there's no way this removal of meta key could break the message contract (like it would be the case with regular proto messages). After all TwirpError is not a message 🤷

Overall, I'd say let's go merging this :)
Thanks a bunch!

@sagikazarmark
Copy link
Member Author

The spec says:

On the network, an error is represented as a JSON response with those properties.

So I guess that's not really an issue in this case.

Thanks for the review and the test!

@sagikazarmark sagikazarmark merged commit 00bc36b into master May 17, 2024
12 checks passed
@sagikazarmark sagikazarmark deleted the fix-meta-serialization branch May 17, 2024 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Meta field in TwirpError should be initialised to empty Map
2 participants