]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
fix(ui-server): defer HTTP broadcast responses until worker replies aggregate (#2028...
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 19 Jul 2026 19:27:45 +0000 (21:27 +0200)
committerGitHub <noreply@github.com>
Sun, 19 Jul 2026 19:27:45 +0000 (21:27 +0200)
commitd8fb33b23ffb5bd59f5e4e1e33e4bdb678303d57
tree0b4729532763fe646704e3f8401e8686cc9c0c9d
parent75897eb250d10bd4b060d2d02f7ba515bc4ac4c2
fix(ui-server): defer HTTP broadcast responses until worker replies aggregate (#2028) (#2037)

The deprecated HTTP UI transport emitted a synthetic `success` the instant the
request handler resolved `undefined` (the broadcast-pending signal), without
awaiting worker replies. PR #2020's Set-based aggregation therefore covered the
WebSocket and MCP transports but not HTTP: a fan-out command reported
`200`/`success` before any worker acted, and the aggregated
`hashIdsFailed`/`responsesFailed` never reached the client.

Align HTTP with the WebSocket and MCP transports (issue #2028 option 1): only
synchronous, non-broadcast procedures respond inline. A broadcast keeps its
already-registered response handler open so the later aggregated `sendResponse`
writes the real status and `hashIdsSucceeded`/`hashIdsFailed`, reusing the
existing 60s safety-net timeout (`UI_SERVER_BROADCAST_CHANNEL_REQUEST_TIMEOUT_MS`)
so a never-arriving aggregation yields a bounded failure with no hung socket.
Client-disconnect cleanup and server-side uuid minting are unchanged; no new
timeout or aggregation path is introduced.

This is a UI SRPC transport-layer fix only; no OCPP PDU/message format changes,
and no change to WebSocket/MCP behavior or the shared aggregation semantics.
src/charging-station/ui-server/UIHttpServer.ts
tests/charging-station/ui-server/UIHttpServer.test.ts