mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 09:13:02 +08:00
Change behavior of NoMatchingSubscribers (#1975)
Change behavior of NoMatchingSubscribers.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
* [Core] Optimized packet serialization of PUBACK and PUBREC packets for protocol version 5.0.0 (#1939, thanks to @Y-Sindo).
|
||||
* [Core] The package inspector is now fully async (#1941).
|
||||
* [Client] Added a dedicated exception when the client is not connected (#1954, thanks to @marcpiulachs).
|
||||
* [Server] The server will no longer send _NoMatchingSubscribers_ when the actual subscription was non success (#1965, BREAKING CHANGE!).
|
||||
* [ManagedClient] Added a new event (SubscriptionsChangedAsync) which is fired when a subscription or unsubscription was made (#1894, thanks to @pdufrene).
|
||||
* [TopicTemplate] Added new extension which provides a template engine for topics (#1932, thanks to @simonthum).
|
||||
|
||||
@@ -257,7 +257,12 @@ namespace MQTTnet.Server
|
||||
|
||||
if (matchingSubscribersCount == 0)
|
||||
{
|
||||
reasonCode = (int)MqttPubAckReasonCode.NoMatchingSubscribers;
|
||||
if (reasonCode == (int)MqttPubAckReasonCode.Success)
|
||||
{
|
||||
// Only change the value if it was success. Otherwise, we would hide an error or not authorized status.
|
||||
reasonCode = (int)MqttPubAckReasonCode.NoMatchingSubscribers;
|
||||
}
|
||||
|
||||
await FireApplicationMessageNotConsumedEvent(applicationMessage, senderId).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user