From 1b7eb3863a1e2263e353d5b191b2de48ebbcaee8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 29 Jan 2024 21:06:59 +0100 Subject: [PATCH] fix: ensure the second stage at handling incoming request is executed later the response is sent MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts | 2 +- src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts index ef879925..53f87ab2 100644 --- a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts @@ -595,7 +595,6 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { chargingStation, commandPayload )) as ResType - this.emit(commandName, chargingStation, commandPayload, response) } catch (error) { // Log logger.error( @@ -636,6 +635,7 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { response, commandName ) + this.emit(commandName, chargingStation, commandPayload, response) } private validatePayload ( diff --git a/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts b/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts index a11026d8..98436cfd 100644 --- a/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts +++ b/src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts @@ -95,7 +95,6 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { chargingStation, commandPayload )) as ResType - this.emit(commandName, chargingStation, commandPayload, response) } catch (error) { // Log logger.error( @@ -136,6 +135,7 @@ export class OCPP20IncomingRequestService extends OCPPIncomingRequestService { response, commandName ) + this.emit(commandName, chargingStation, commandPayload, response) } private validatePayload ( -- 2.34.1