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 resolve field type on double field types #29

Merged
merged 2 commits into from
Mar 20, 2023

Conversation

jackkleeman
Copy link
Contributor

@jackkleeman jackkleeman commented Mar 16, 2023

It is completely valid for the field type to be missing; some compiles (eg, js) will not include default enum values in the message, and in this case the default field type is double. When a double is sent currently, a missing field type error is returned. This error should never be returned. As is done elsewhere, we should use the getter instead of reading the field directly so that the default value is automatically included where needed.

@codecov
Copy link

codecov bot commented Mar 16, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.05 ⚠️

Comparison is base (8e245d6) 75.49% compared to head (8f771d1) 75.45%.

❗ Current head 8f771d1 differs from pull request most recent head 851fe1e. Consider uploading reports for the commit 851fe1e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
- Coverage   75.49%   75.45%   -0.05%     
==========================================
  Files          30       30              
  Lines        5223     5214       -9     
==========================================
- Hits         3943     3934       -9     
  Misses       1280     1280              
Impacted Files Coverage Δ
prost-reflect/src/descriptor/build/resolve.rs 67.52% <100.00%> (+0.46%) ⬆️

... and 6 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@andrewhickman
Copy link
Owner

Thanks for the PR!

Please could you add a test for this case to prost-reflect/tests/main.rs or prost-reflect/src/descriptor/tests.rs?

It is completely valid for the field type to be missing; some compilers (eg, js) will not include default enum values in the message, and in this case the default field type is double. When a double is sent currently, a missing field type error is returned. This error should never be returned. As is done elsewhere, we should use the getter instead of reading the field directly so that the default value is automatically included where needed.
@jackkleeman
Copy link
Contributor Author

Sure - done @andrewhickman

@andrewhickman andrewhickman merged commit 75ef3e6 into andrewhickman:main Mar 20, 2023
@andrewhickman
Copy link
Owner

Thanks! I've published 0.10.3 with this change

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.

2 participants