From 1ec17ecde818c7964816966f8defe2ec0a7c76c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 11 Sep 2022 17:06:59 +0200 Subject: [PATCH] Ensure requests are purged from the cache in case of responses processing error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 1704821c..53f9076f 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1568,6 +1568,11 @@ export default class ChargingStation { error as OCPPError, commandName ?? requestCommandName ?? null ); + } else if ( + [MessageType.CALL_RESULT_MESSAGE, MessageType.CALL_ERROR_MESSAGE].includes(messageType) + ) { + // Remove the request from the cache + this.requests.delete(messageId); } } } -- 2.34.1