From 0356eec98d139d13e47a15ad2e1aac73e1ecca4f Mon Sep 17 00:00:00 2001 From: ch4nsuk3 Date: Fri, 8 Nov 2024 17:36:19 -0600 Subject: [PATCH] Added Comment Explaining Behavior Added a comment referencing the MQTT specification for why the server may not immediately respond to an UNSUBACK --- adafruit_minimqtt/adafruit_minimqtt.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/adafruit_minimqtt/adafruit_minimqtt.py b/adafruit_minimqtt/adafruit_minimqtt.py index 72b43c9..2724eca 100644 --- a/adafruit_minimqtt/adafruit_minimqtt.py +++ b/adafruit_minimqtt/adafruit_minimqtt.py @@ -865,6 +865,8 @@ def unsubscribe( # noqa: PLR0912, Too many branches self._subscribed_topics.remove(t) return if op != MQTT_PUBLISH: + # [3.10.4] The Server may continue to deliver existing messages buffered for delivery + # to the client prior to sending the UNSUBACK Packet. raise MMQTTException( f"invalid message received as response to UNSUBSCRIBE: {hex(op)}" )