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

Generated code doesn't honor proto3 optional semantics #848

Closed
aohren opened this issue Mar 25, 2021 · 7 comments
Closed

Generated code doesn't honor proto3 optional semantics #848

aohren opened this issue Mar 25, 2021 · 7 comments
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.

Comments

@aohren
Copy link

aohren commented Mar 25, 2021

Google Ads API uses proto3 optional throughout, and the distinction between a field having a default value vs. not being present at all in a message is meaningful. The current behavior of the generated Node.js protos appears to be setting default values for all fields, regardless of whether the message actually has the field set.

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Mar 27, 2021
@rosslavery
Copy link

Just adding +1 here to mention this is impacting the Node.js client library for the Google Ads API: https://github.com/Opteo/google-ads-api .

With the upcoming deprecation of Ads API V4/5 in June, developers using this library need enough time to migrate versions without encountering errors as a result of this bug.

@Zikoel
Copy link

Zikoel commented Apr 27, 2021

Are we waiting for that issue the PR #852 ? That is chained to another PR on google-gax package here and that is chained to protobufjs PR here ?

@alexander-fenster
Copy link
Member

We are only waiting for protobuf.js release, then it will just go up through the dependency chain with no changes needed in google-gax or here. To try it, npm install protobuf.js@next everywhere in the chain :)

@alexander-fenster
Copy link
Member

(and as for protobuf.js release, it's coming soon - I'm working on it; it's a third party library but we can release it)

@alexander-fenster alexander-fenster self-assigned this Apr 28, 2021
@alexander-fenster alexander-fenster added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. and removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 28, 2021
@alexander-fenster
Copy link
Member

It should all work now (after reinstalling dependencies and regenerating protos with npm run compile-protos).

@alexander-fenster
Copy link
Member

protobufjs v6.11.0

@Zikoel
Copy link

Zikoel commented Apr 29, 2021

Absolutely awesome work, many thanks! I have a question: The issue is intended to be fixed on the version 1.3.0 or on the next versions? I ask that because as I can see the dependency chain for the v1.3.0 is gapic-generator-typescript@1.3.0 ->google-gax@2.11.2 -> protobufjs@6.10.2 but the fix is from google-gax@2.12.0 -> protobufjs@6.11.0, I'm wrong reading this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.
Projects
None yet
Development

No branches or pull requests

5 participants