Skip to content

sinceVersion not respected for newly added choices in sets #1035

Open
@writeoncereadmany

Description

@writeoncereadmany

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions