(msg: ClientHelloMessage)
| 268 | } |
| 269 | |
| 270 | private async onClientHello(msg: ClientHelloMessage): Promise<void> { |
| 271 | this.gotClientHello = true; |
| 272 | const { subscriptions, cursors } = msg.payload; |
| 273 | |
| 274 | const sync = await this.syncSessions(subscriptions, cursors); |
| 275 | |
| 276 | this.logger.info( |
| 277 | { |
| 278 | acceptedCount: sync.accepted.length, |
| 279 | resyncRequiredCount: sync.resyncRequired.length, |
| 280 | }, |
| 281 | 'client hello', |
| 282 | ); |
| 283 | this.send( |
| 284 | buildAck(msg.id, 0, 'success', { |
| 285 | accepted_subscriptions: sync.accepted, |
| 286 | resync_required: sync.resyncRequired, |
| 287 | cursors: sync.serverCursors, |
| 288 | }), |
| 289 | ); |
| 290 | } |
| 291 | |
| 292 | /** |
| 293 | * Shared client_hello/subscribe session sync: |
no test coverage detected