Browse Source

fix(mqtt): lift paho inflight ceiling to prevent QoS=1 session wedge (#1164)

  paho's default max_inflight_messages=20 silently fills on Bambu's broker
  after ~16-20 cumulative commands per session, leaving publish() returning
  success while packets sit in paho's internal queue. force_reconnect heals
  it because the inflight queue is per-session, but it costs one wasted
  user action to trigger.

  Lifting the ceiling to 1000 keeps QoS=1 untouched (deliberately chosen
  for cross-model reliability — A1, P1S, X1C, H2D, P2S, X2D all need it)
  and removes the inflight queue as the bottleneck without changing
  wire-protocol behaviour. The 0.2.4b2 watchdog reconnect stays as
  defence-in-depth.

  Diagnosis credit: RosdasHH's QoS=1/0/2 bisect on #1164.
maziggy 3 weeks ago
parent
commit
875d80ad3c

File diff suppressed because it is too large
+ 0 - 0
CHANGELOG.md


+ 7 - 0
backend/app/services/bambu_mqtt.py

@@ -3072,6 +3072,13 @@ class BambuMQTTClient:
             protocol=mqtt.MQTTv311,
         )
 
+        # Bambu's broker has racy PUBACK matching with paho's QoS=1 inflight
+        # tracking (#1164). The default ceiling of 20 wedges sessions after
+        # ~16-20 cumulative commands; lifting it well above any realistic
+        # session count keeps QoS=1 working without changing wire-protocol
+        # behaviour across printer models.
+        self._client.max_inflight_messages_set(1000)
+
         self._client.username_pw_set("bblp", self.access_code)
         self._client.on_connect = self._on_connect
         self._client.on_disconnect = self._on_disconnect

File diff suppressed because it is too large
+ 0 - 0
static/assets/index-Ba_hWP_H.js


File diff suppressed because it is too large
+ 0 - 0
static/assets/index-iyRP9PYM.css


Some files were not shown because too many files changed in this diff