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

sinceVersion not respected for newly added choices in sets #1035

Open
writeoncereadmany opened this issue Dec 12, 2024 · 0 comments
Open

sinceVersion not respected for newly added choices in sets #1035

writeoncereadmany opened this issue Dec 12, 2024 · 0 comments

Comments

@writeoncereadmany
Copy link
Contributor

Sets allow choices to be annotated with the sinceVersion attribute, but this is not taken into account when decoding messages.

We encountered this problem when a new choice was added to a set in newer version of a protocol, correctly annotated with sinceVersion. The messages we sent had neglected to call clear() on the set before setting the fields, so the remainder of the bytes containing the bitset had arbitrary data in (we have since fixed this), and the consumer was reading the new choice which was occasionally accidentally set.

I would argue the decoder should not attempt to read a choice that's annotated sinceVersion where the sinceVersion is higher than the wire message's version, returning a default false instead.

Alternatively, if sinceVersion shouldn't be factored into generated decoders, it should not be allowed as an annotation on choices, as it gives a false sense of security.

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

No branches or pull requests

1 participant