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.