2 Commits

Author SHA1 Message Date
Andrey Antukh
11eb60712a Add test hooks for websocket listener options
The generic websocket listener now returns the handler map
with the resolved options attached in its metadata (under the
::options key), exposing the codecs and internal state for
testing and introspection purposes without affecting the
public api.

The http-handler of the notifications endpoint is now public,
and the websocket tests are extended to cover the wiring of
the negotiated payload format into the listener: json codecs
selected via Accept header or _fmt parameter, and the transit
default for unsignaled requests.

Closes #11409

AI-assisted-by: glm-5.3-flash
2026-08-28 10:16:02 +00:00
Andrey Antukh
2332be1e2c Negotiate transit/JSON payload format on WebSocket
Extend the transit/JSON content negotiation to the WebSocket
notifications endpoint (/ws/notifications). The format is
negotiated once on the upgrade request (Accept header or
_fmt=json query parameter, same rules as the rest of the RPC
API) and applies bidirectionally: outbound notification
messages are encoded with the negotiated encoder and inbound
client messages are decoded accordingly.

The generic websocket protocol implementation now accepts
encode/decode functions as listener options, defaulting to
the historical transit encoding. A small normalization step
converts JSON decoded messages (:type to keyword and entity
ids to UUID objects) into the same shape produced by transit.

Closes #11409

AI-assisted-by: glm-5.3-flash
2026-08-28 09:39:27 +00:00