You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here some reports regarding bugs found so far when publishing messages using c# client library.
🐛 Bug Report
A published message with PayloadFormatIndicator = UTF8Encoded is always sent with Unspecified. When a Validate() method is called, it is always being set to Unspecified when contains both values. This is wrong, it should only throw an exception if it contains a different value, Unspecified if it is nullalble or keep the current value.
🔬 How To Reproduce
Steps to reproduce the behavior:
Define a client of type HiveMQClient with a specific options for your configuration.
Create a event handler for client.OnPublishSent event and assign to it. The event handler should print a value from OnPublishSentEventArgs.PublishPacket.Message.PayloadFormatIndicator.
Create an instance of MQTT5PublishMessage and set a value as PayloadFormatIndicator = MQTT5PayloadFormatIndicator.UTF8Encoded.
Finally publish the message defined in step 3 as await client.PublishAync(message).ConfigureAwait(false)
Doh! Great find @dalbarracin - I'll fix that up soon. Thanks for reporting!
dalbarracin
changed the title
Payload format indicator contains always "UNESPECIFIED" value after publishing
Payload format indicator contains always "UNSPECIFIED" value after publishing
Nov 7, 2023
Hello guys :)
Here some reports regarding bugs found so far when publishing messages using c# client library.
🐛 Bug Report
A published message with
PayloadFormatIndicator = UTF8Encoded
is always sent withUnspecified
. When aValidate()
method is called, it is always being set toUnspecified
when contains both values. This is wrong, it should only throw an exception if it contains a different value,Unspecified
if it is nullalble or keep the current value.🔬 How To Reproduce
Steps to reproduce the behavior:
HiveMQClient
with a specific options for your configuration.client.OnPublishSent
event and assign to it. The event handler should print a value fromOnPublishSentEventArgs.PublishPacket.Message.PayloadFormatIndicator
.MQTT5PublishMessage
and set a value asPayloadFormatIndicator = MQTT5PayloadFormatIndicator.UTF8Encoded
.await client.PublishAync(message).ConfigureAwait(false)
Code Example
The code in discussion can be found here
Environment
The client is ran in
Windows 10 OS
withdotnet 6 sdk
andHiveMQTT v0.5.0
C# nuget package.📈 Expected behavior
The value of the
PayloadFormatIndicator
should be the one it is set before publishing.The text was updated successfully, but these errors were encountered: