From 1576c8bbbbf453d433a8dd106cb7d4093aa8e846 Mon Sep 17 00:00:00 2001 From: Dennis Ge <24434031+DGessinger@users.noreply.github.com> Date: Thu, 2 Jul 2026 23:49:27 +0200 Subject: [PATCH] Fix: Add ALL_MODULES_STARTED fallback for missed DOM_OBJECTS_CREATED --- MMM-Remote-Control.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MMM-Remote-Control.js b/MMM-Remote-Control.js index 7d7a278..c8d579d 100644 --- a/MMM-Remote-Control.js +++ b/MMM-Remote-Control.js @@ -63,6 +63,14 @@ Module.register("MMM-Remote-Control", { Log.debug(`${this.name} received a module notification: ${notification} from sender: ${sender}`); switch (notification) { case "DOM_OBJECTS_CREATED": + // Fallback: DOM_OBJECTS_CREATED can occasionally fire before this module ++ // has fully registered as a notification listener (race condition seen with ++ // newer Node.js/Electron versions), causing the event to be missed and the ++ // module to stay permanently "not initialized". ALL_MODULES_STARTED is ++ // received reliably afterwards and acts as a safety net. ++ case "ALL_MODULES_STARTED": ++ if (this.currentDataSent) { break; } ++ this.currentDataSent = true; this.sendSocketNotification("REQUEST_DEFAULT_SETTINGS"); this.sendCurrentData(); break;