From 77867a7bcac8d9b7aaee938e48cac7b0038a2ffd Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 31 Mar 2026 22:14:39 +0200 Subject: [PATCH] fix(auth): use Math.floor for TTL computation to avoid serving expired cache entries --- src/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.ts b/src/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.ts index 483e331a..f8f7d3d9 100644 --- a/src/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.ts +++ b/src/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.ts @@ -563,7 +563,7 @@ export class OCPPAuthServiceImpl implements OCPPAuthService { if (expiryDate != null) { const expiry = convertToDate(expiryDate) if (expiry != null) { - const ttlSeconds = Math.ceil((expiry.getTime() - Date.now()) / 1000) + const ttlSeconds = Math.floor((expiry.getTime() - Date.now()) / 1000) if (ttlSeconds <= 0) { logger.debug( `${this.chargingStation.logPrefix()} ${moduleName}.updateCacheEntry: Skipping expired entry for ${truncateId(identifier)}` -- 2.53.0