From: Jérôme Benoit Date: Mon, 29 Jan 2024 20:06:59 +0000 (+0100) Subject: fix: ensure the second stage at handling incoming request is executed X-Git-Tag: v1.2.33~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1b7eb3863a1e2263e353d5b191b2de48ebbcaee8;p=e-mobility-charging-stations-simulator.git fix: ensure the second stage at handling incoming request is executed later the response is sent Signed-off-by: Jérôme Benoit --- 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 (