From 3e8dea439e02e67a1a1ac32eb9da4ecff62ba24a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 21 Mar 2026 20:26:19 +0100 Subject: [PATCH] fix(lifecycle): clear auth service on template reload and station reset Auth service instance was persisting across template reloads and station resets, causing stale adapters if OCPP version changed. - Add OCPPAuthServiceFactory.clearInstance() before initialize() in template file change handler - Add OCPPAuthServiceFactory.clearInstance() before initialize() in reset() method --- src/charging-station/ChargingStation.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 0764f6b9..a89f8c55 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -872,6 +872,7 @@ export class ChargingStation extends EventEmitter { } // eslint-disable-next-line @typescript-eslint/no-non-null-assertion await sleep(this.stationInfo!.resetTime!) + OCPPAuthServiceFactory.clearInstance(this) this.initialize() this.start() } @@ -935,6 +936,7 @@ export class ChargingStation extends EventEmitter { this.sharedLRUCache.deleteChargingStationTemplate(this.templateFileHash) // eslint-disable-next-line @typescript-eslint/no-non-null-assertion this.idTagsCache.deleteIdTags(getIdTagsFile(this.stationInfo!)!) + OCPPAuthServiceFactory.clearInstance(this) // Initialize this.initialize() // Restart the ATG -- 2.43.0