]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
fix: ui websocket server stops responding to broadcast procedures (#1643)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 9 Jan 2026 15:16:39 +0000 (16:16 +0100)
committerGitHub <noreply@github.com>
Fri, 9 Jan 2026 15:16:39 +0000 (16:16 +0100)
commit79d779d92e277415afbbe21dbfc0892323d351f2
tree6b15df063e913a5d66e183483befd4fe831e4720
parent0d1e3da5d7211b05e8d71652824abb5814d8d93b
fix: ui websocket server stops responding to broadcast procedures (#1643)

* fix: ui websocket server stops responding to broadcast procedures (#1642)

remove premature response handler deletion in .finally() block that was
causing broadcast procedures (AUTHORIZE, DELETE_CHARGING_STATIONS) to
fail. response handlers are now only deleted on error or when sendResponse()
is called with the actual response.

root cause: broadcast procedures return undefined from requestHandler() and
wait for worker responses. the .finally() block was deleting handlers before
the response arrived, making the server unable to send the response back
to the client.

includes comprehensive test coverage:
- UIWebSocketServer.test.ts: 11 tests for WebSocket-specific behavior
- UIHttpServer.test.ts: 11 tests for HTTP-specific behavior
- AbstractUIService.test.ts: 9 tests for base service functionality
- test utilities and constants for consistent test data

all tests follow repository conventions and verify the fix prevents
regression of this bug.

* fix: correct UIHttpServer test expectations for response format

The UIHttpServer.sendResponse() method sends only the payload part of the
protocol response, not the full [uuid, payload] tuple. Fixed two tests that
were incorrectly expecting the full tuple format.

Tests affected:
- Verify response payload serialization
- Verify response with error details

All 31 UI server tests now pass correctly.
.clinerules/copilot-instructions.md [new file with mode: 0644]
src/assets/station-templates/keba-ocpp2.station-template.json [new file with mode: 0644]
src/charging-station/ui-server/UIWebSocketServer.ts
tests/charging-station/ui-server/UIHttpServer.test.ts [new file with mode: 0644]
tests/charging-station/ui-server/UIServerTestConstants.ts [new file with mode: 0644]
tests/charging-station/ui-server/UIServerTestUtils.ts [new file with mode: 0644]
tests/charging-station/ui-server/UIWebSocketServer.test.ts [new file with mode: 0644]
tests/charging-station/ui-server/ui-services/AbstractUIService.test.ts [new file with mode: 0644]