refactor: explicit condition check in OCPP stack
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 20 Nov 2023 21:43:12 +0000 (22:43 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 20 Nov 2023 21:43:12 +0000 (22:43 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/OCPPRequestService.ts

index 794f3e255a28c3b26021b260244d1cadeddd8a95..07793a8fd7f5ba498cb5a23581f6d60a84d4c019 100644 (file)
@@ -387,7 +387,10 @@ export abstract class OCPPRequestService {
                 errorCallback,
               );
             }
-          } else if (messageType === MessageType.CALL_MESSAGE) {
+          } else if (
+            params?.skipBufferingOnError === true &&
+            messageType === MessageType.CALL_MESSAGE
+          ) {
             // Remove request from the cache
             chargingStation.requests.delete(messageId);
           }