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 for wrappers with a zero value #7201

Merged
merged 1 commit into from Feb 12, 2020
Merged

Fix for wrappers with a zero value #7201

merged 1 commit into from Feb 12, 2020

Commits on Feb 12, 2020

  1. Fix for wrappers with a zero value (#7195)

    * Add failing tests for issues with wrapped values where the value is the default
    
    * Add test for wrapped values without a value set
    
    * Bugfix for wrapper types with default values.
    
    The previous optimizations for wrapper types had a bug that prevented
    wrappers from registering as "present" if the "value" field was not
    present on the wire.
    
    In practice the "value" field will not be serialized when it is zero,
    according to proto3 semantics, but due to the optimization this
    prevented it from creating a new object to represent the presence of the
    field.
    
    The fix is to ensure that if the wrapper message is present on the wire,
    we always initialize its value to zero.
    
    Co-authored-by: Dan Quan <dan@quan.io>
    2 people authored and rafi-kamal committed Feb 12, 2020
    Configuration menu
    Copy the full SHA
    cd24cd1 View commit details
    Browse the repository at this point in the history