When publishing a message with user properties, keys of those properties are ignored. This is causing issues (tested with emqx/emqx:5.3.0), the broker terminates the connection.
Code to reproduce the issue:
// Connect to your MQTT 5 broker first...
// Then publish a message with user properties
let props = MqttPublishProperties()
props.userProperty = ["test":"userprop", "test2": "userprop2"]
mqtt5.publish("chat/test", withString: "id:123", properties: props)
When publishing a message with user properties, keys of those properties are ignored. This is causing issues (tested with emqx/emqx:5.3.0), the broker terminates the connection.
Code to reproduce the issue:
Error logs:
I found that both the key.bytesWithLength and value.bytesWithLength need to be concatenated.
I tested the fix against emqx/emqx:5.3.0.
Thanks 😊