]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
fix(ocpp): from-zero audit — Critical + High spec conformance and safety fixes (...
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 6 Jul 2026 17:33:06 +0000 (19:33 +0200)
committerGitHub <noreply@github.com>
Mon, 6 Jul 2026 17:33:06 +0000 (19:33 +0200)
commit6da3e6f8cd22ba7aa297d574a73b261b2739db35
treeab31f01e876fe53a5ac57eda5a575147cd4d2938
parentf8d8e03f399f98fdbfec4716c555f259b39ab5ec
fix(ocpp): from-zero audit — Critical + High spec conformance and safety fixes (#1961)

Eleven commits from the from-zero audit (three review rounds).

Fixes:
- C2 (§4.2) forbid non-triggered outbound messages in Pending state under non-strict compliance
- H2 emit StatusNotification(Finishing) before StopTransaction.req in the non-remote stop path
- H6 (§5.11) RemoteStart auto-select skips connectors reserved for a different idTag
- H9 partial: .unref() on 5 lifecycle timer sites (3 setTimeout + 2 setInterval) so they no longer block node.js shutdown; per-site safety-invariant comments
- H10 partial: initialize 5 string ChargingStation fields in the constructor; drop their definite-assignment markers
- H11 log the errors previously swallowed by .catch(() => undefined) in AbstractUIServer

Review follow-ups:
- Correct method name in stop() metrics-cleanup log prefix
- Clarify runMetricsScrape catch-log wording
- Correct spec-citation in stopTransactionOnConnector test title

Gates: format / typecheck / lint / build / test (2951 pass / 0 fail / 6 skipped) all pass at tip ca6b0182. Skott circular-dependency count preserved at 61.

Empirically-rescinded audit findings: H4, H5, H8.
Deferred with concrete rationale: H7, H9 residual, H10 residual.
src/charging-station/ChargingStation.ts
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts
src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts
src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts
src/charging-station/ocpp/OCPPRequestService.ts
src/charging-station/ui-server/AbstractUIServer.ts
tests/charging-station/ocpp/OCPPServiceOperations.test.ts