From 56f0a2c31ca817cbd1eceed44b54333afbc33863 Mon Sep 17 00:00:00 2001 From: Christian <6939810+chkr1011@users.noreply.github.com> Date: Wed, 9 Nov 2022 20:13:59 +0100 Subject: [PATCH] Fix validation of topic in managed client (#1567) --- .github/workflows/ReleaseNotes.md | 3 ++- Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ReleaseNotes.md b/.github/workflows/ReleaseNotes.md index d08fa6b0..1614de15 100644 --- a/.github/workflows/ReleaseNotes.md +++ b/.github/workflows/ReleaseNotes.md @@ -1,5 +1,6 @@ * [Core] Fixed several dead locks by implementing a new async signal (#1552) * [Client] All waiting tasks will now fail when the client connection gets closed. This fixes several freezes (#1561) +* [ManagedClient] The topic is no longer declared as invalid if a topic alias is used (#1395). * [Server] Fixed duplicated invocation of the event _ClientAcknowledgedPublishPacketAsync_ for QoS level 2 (#1550) * [Server] Fixed issue in upgrading and downgrading of QoS levels for subscriptions and retained messages (#1560) -* [Server] Fixed memory leak when old sessions are discarded (#1553) \ No newline at end of file +* [Server] Fixed memory leak when old sessions are discarded (#1553) diff --git a/Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs b/Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs index 2583a605..c979627c 100644 --- a/Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs +++ b/Source/MQTTnet.Extensions.ManagedClient/ManagedMqttClient.cs @@ -160,7 +160,7 @@ namespace MQTTnet.Extensions.ManagedClient throw new InvalidOperationException("call StartAsync before publishing messages"); } - MqttTopicValidator.ThrowIfInvalid(applicationMessage.ApplicationMessage.Topic); + MqttTopicValidator.ThrowIfInvalid(applicationMessage.ApplicationMessage); ManagedMqttApplicationMessage removedMessage = null; ApplicationMessageSkippedEventArgs applicationMessageSkippedEventArgs = null;