fix: update modified field handling for blob and bucket with json transport to properly clear fields #2664
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.
Update StorageImpl#update(BlobInfo) and StorageImpl#update(BucketInfo) to only send modified fields in the case of an actual update. Currently, it simply sends the json version of the current info, this can mean that if a field is cleared the request to gcs doesn't actually include the field to clear.
This same issue does not impact grpc transport, because grpc transport has an explicit
update_maskthat is populated.Add some tests to ensure things work and continue to work.
In order to handle this, we have to explicitly include a
Data.nullOf(Class)in the respective apiary model. Each of theData.nullOfs must match the type of the field. Because of this, we now need to track the apiary type for each field. To this end, a new internal field has been added to BlobField and BucketField to map to the corresponding apiary type.Fixes #2662