From 7337563a60ab9b6172afca92b64fbc485e85e18f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 25 Mar 2026 22:20:43 +0100 Subject: [PATCH] fix: post updated message on connectorStatusChanged to fix stale UI cache The .finally() in internalSendMessage emits the updated event BEFORE sendAndSetConnectorStatus updates connectorStatus.status, causing the UI cache to snapshot the old status. The connectorStatusChanged event fires AFTER the update, so posting an updated message on it ensures the cache receives the correct connector status. --- src/charging-station/ChargingStation.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 33d20155..68beff82 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -251,6 +251,9 @@ export class ChargingStation extends EventEmitter { this.on(ChargingStationEvents.updated, () => { parentPort?.postMessage(buildUpdatedMessage(this)) }) + this.on(ChargingStationEvents.connectorStatusChanged, () => { + parentPort?.postMessage(buildUpdatedMessage(this)) + }) this.on(ChargingStationEvents.accepted, () => { this.startMessageSequence( this.wsConnectionRetryCount > 0 -- 2.43.0