caelum0x e8e48c28bc feat: real-time WebSocket matchmaking push (replaces poll-only)
Backend: on a match the matcher publishes a match-found event to a
Redis channel; modules/matchmaking/notifier.ts runs a per-instance
subscriber that forwards to locally-connected sockets, so fan-out is
correct across multiple API instances. New WS /matchmaking/subscribe
route (@fastify/websocket) authenticates via ?token= (WS handshakes
can't carry Authorization), registers the socket, and replays the
current ticket on connect to close the queue<->connect race.

Web: openMatchSocket() opens the subscribe socket as an accelerator and
keeps the ~1s poll as the reliable backstop (and the only path where
WebSocket is unavailable, e.g. jsdom). Pure matchSocketUrl builder tested.

10 new backend tests (notifier registry/dispatch/publish, token helper,
WS route registration) + matcher publish assertions; 3 new web tests.
108 backend / 21 web tests green.
2026-07-27 17:46:41 +03:00
..