-
Notifications
You must be signed in to change notification settings - Fork 349
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
meta generated for messages with oneOf properties is incorret for other properties #1021
Comments
@lukealvoeiro I haven't looked into this very much, but You'd mentioned bumping ts-proto-descriptors, but I don't think that ended up happening, but I kinda thought it shouldn't really matter since it'd still be using the generated-by-older-ts-proto versions of the |
I just stumbled over this same thing: I can't reconstruct I think this might be coming from running the I'm not quite sure what a good fix would look like. I've tried removing the Is there a good way to attach a debugger to the plugin to be able to step through the code while the .ts files are generated? That would really help me to get into this further. |
I know I've done that before, but it looks like maybe in a previous build setup (when we had the My current guess of what would work is to take the
Like Note that Actually wouldn't be a bad idea to just have a Thanks for looking into this @jonaskello ! |
With that debugging actually worked on the first try! 👍 Here's what I've tried so far: Removing the Where this approach fails is when generating the I can see that's by design (changelog of v1.61.0) and is perfectly fine if we're using the properties directly, but using these objects inside What might work is to always set the option on the object itself instead of updating it's prototype's value
do
...which looks ridiculous, but actually does what we want - attach the property to the actual object instead of its prototype if and only if the value differs from the default value. This appears to fix the Anyway, that's as far as I got today. If you have any more insights that'd be great! |
I see an issue in the generated meta when a class contains a
oneof
type.this class
generates
oneOfIndex: 0
for all 3 properties, not just the 2 properties in theoneof
field.This is with version
The generated meta. Notice field
some_type
also hasoneOfIndex: 0
The text was updated successfully, but these errors were encountered: