-
Notifications
You must be signed in to change notification settings - Fork 65
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
Fixing client serialization bugs #402
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
…ds. Also fixed an issue where we sometimes were serializing the selected_index field across the wire which would end up getting captured in the unknown fields.
jasonmreding
commented
Jan 9, 2025
jasonmreding
commented
Jan 9, 2025
jasonmreding
commented
Jan 9, 2025
jasonmreding
commented
Jan 9, 2025
jasonmreding
commented
Jan 9, 2025
jasonmreding
commented
Jan 9, 2025
* master: Run grpc code generation in a private application context (#401)
bkeryan
requested changes
Jan 13, 2025
bkeryan
approved these changes
Jan 14, 2025
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.
Description
This addresses a number of client serialization issues around sparse enums and oneof fields.
selected_index
field in the cluster which made it look like no fields from the oneof were ever set when reading response data on the client.selected_index
field across the wire which would end up getting captured in the unknown fields in the message on the other end.selected_index
field set correctly on their class cluster.#396
#343
Implementation
Most of these were only issues with the
LVMessageEfficient
derived class which I believe is only used for unary calls from the client. Otherwise, we end up using theClusterDataCopier
methods which already handled this.LVMessage
now tracks data for which field of a oneof is selected. This data structure is updated when parsing a message. It is also updated byClusterDataCopier
when constructing aLVMessage
from its cluster representation.LVMessageEfficient
now assigns theselected_index
field in the class cluster for a oneof duringPostInteralParseAction
using the new data structure added toLVMessage
.LVMessageEfficient
now has a hand written override forParseEnum
which translates from enum values from a proto file (which can be "sparse" or non-sequential) to the LV assigned enum value for the cluster since LV only supports sequential enum values.selected_index
field values for the class cluster, we now iterate over_elements
instead of_mappedElements
. Since we use -1 as the field number for allselected_index
fields, there will only ever be one entry in_mappedElements
. This obviously doesn't work if the message has more than one oneof field.Testing
Manually tested generation of both the client and the server using proto APIs that included nested messages, enums, and oneof fields. Tested both Win32 and Win64 using LV 2019 and LV 2024.