From: Jérôme Benoit Date: Sat, 2 May 2026 21:21:24 +0000 (+0200) Subject: fix: do not nullify wsConnection in onError handler X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f9acca43755ddb79c21d1c05a74b0c02f3059da3;p=e-mobility-charging-stations-simulator.git fix: do not nullify wsConnection in onError handler The ws library guarantees that a 'close' event always follows an 'error' event. Eagerly setting wsConnection to null in onError caused the subsequent onClose handler to emit an 'updated' event with wsState undefined, making the UI display 'unknown' instead of 'closed'. --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 64591099..7f981991 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -2280,7 +2280,6 @@ export class ChargingStation extends EventEmitter { } private onError (error: WSError): void { - this.closeWSConnection() logger.error(`${this.logPrefix()} ${moduleName}.onError: WebSocket error:`, error) }