* Send a client_hello + subscribe to one session. Drains the resulting * `ack` so subsequent `receiveType(conn, ...)` calls see only event frames.
(conn: Conn, clientId: string, sessionId: string)
| 151 | * `ack` so subsequent `receiveType(conn, ...)` calls see only event frames. |
| 152 | */ |
| 153 | async function helloAndSubscribe(conn: Conn, clientId: string, sessionId: string): Promise<void> { |
| 154 | await receiveType(conn, 'server_hello', 1000); |
| 155 | conn.ws.send( |
| 156 | JSON.stringify({ |
| 157 | type: 'client_hello', |
| 158 | id: `cli_${clientId}`, |
| 159 | payload: { client_id: clientId, subscriptions: [sessionId] }, |
| 160 | }), |
| 161 | ); |
| 162 | await receiveType(conn, 'ack', 1000); |
| 163 | } |
| 164 | |
| 165 | describe('WS broadcast + per-session seq (W5.2)', () => { |
| 166 | it('two subscribers both receive seq=1 then seq=2 for the same session', async () => { |
no test coverage detected