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
ManagedMqttClient simply calls await InternalClient.SubscribeAsync(subscribeOptionsBuilder.Build()).ConfigureAwait(false); without handling the return value.
The return value of type MqttClientSubscribeResult contains a collection of MqttClientSubscribeResultItem which have a ResultCode.
This result code can indicate subscription errors, such as 0x8F (TopicFilterInvalid).
I'd rate this as a SEVERE bug, because the caller does not know whether subscriptions succeeded or failed.
Which component is your bug related to?
ManagedClient
To Reproduce
Steps to reproduce the behavior:
MQTTnet version 4.3.3.952
Optional: set up a MqttNetEventLogger to log verbose messages (to print the SubAck packet with subscription result code)
Call await client.SubscribeAsync(invalidTopic)
Expected behavior
Either await client.SubscribeAsync(invalidTopic) should fail with an exception, or due to the background processing and event-based architecture of ManagedMqttClient fire a new event such as "SubscriptionsFailedAsync" with args that contain the subscription result code.
The text was updated successfully, but these errors were encountered:
It looks like this is already implemented on master with the event SubscriptionsChangedAsync (commit aabf180).
When is this going to be release as a nuget package?
Describe the bug
ManagedMqttClient
simply callsawait InternalClient.SubscribeAsync(subscribeOptionsBuilder.Build()).ConfigureAwait(false);
without handling the return value.The return value of type
MqttClientSubscribeResult
contains a collection ofMqttClientSubscribeResultItem
which have aResultCode
.This result code can indicate subscription errors, such as 0x8F (TopicFilterInvalid).
I'd rate this as a SEVERE bug, because the caller does not know whether subscriptions succeeded or failed.
Which component is your bug related to?
To Reproduce
Steps to reproduce the behavior:
MqttNetEventLogger
to log verbose messages (to print the SubAck packet with subscription result code)await client.SubscribeAsync(invalidTopic)
Expected behavior
Either
await client.SubscribeAsync(invalidTopic)
should fail with an exception, or due to the background processing and event-based architecture of ManagedMqttClient fire a new event such as "SubscriptionsFailedAsync" with args that contain the subscription result code.The text was updated successfully, but these errors were encountered: