From c0c6b6829a0204cbf155b391dab8e8d5faed01e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20W=C3=BCrthner?= Date: Tue, 20 Jun 2023 17:03:02 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Ensure=20subscription=20changes?= =?UTF-8?q?=20cause=20a=20history=20message=20(#4752)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/server/util/sockjs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/octoprint/server/util/sockjs.py b/src/octoprint/server/util/sockjs.py index 3140887d7..834bbb972 100644 --- a/src/octoprint/server/util/sockjs.py +++ b/src/octoprint/server/util/sockjs.py @@ -381,10 +381,12 @@ class PrinterStateConnection( self._subscriptions["plugins"] = plugins self._subscriptions["events"] = events - if state and not old_state: - # trigger initial data + if state and state != old_state: + # state is requested and was changed from previous state + # we should send a history message to send the update data self._printer.send_initial_callback(self) elif old_state and not state: + # we no longer should send state updates self._initial_data_sent = False def on_printer_send_current_data(self, data):