Skip to content

MqttProperties.isEmpty() ignores user properties and subscription identifiers #16574

@ShadowySpirits

Description

@ShadowySpirits

Netty version: 4.2.13

While testing MQTT 5 acknowledgements and control packets, I found that User Properties can be present in the message object but missing on the wire after encoding.

MqttProperties.isEmpty() only checks the regular props map and ignores userProperties and subscriptionIds. Because of that, MQTT 5 encoding paths that decide whether to write the reason code and properties based on
properties.isEmpty() can incorrectly take the shortest form and skip property encoding entirely.

This affects at least:

  • PUBACK
  • PUBREC
  • PUBREL
  • PUBCOMP
  • DISCONNECT
  • AUTH

when reasonCode == 0 and the properties only contain User Property values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions