| 393 | } |
| 394 | |
| 395 | private onUnsubscribe(msg: UnsubscribeMessage): void { |
| 396 | const { session_ids } = msg.payload; |
| 397 | for (const sid of session_ids) { |
| 398 | this.unsubscribe(sid); |
| 399 | this.cursorsBySession.delete(sid); |
| 400 | |
| 401 | if (this.fsWatchHandler !== undefined) { |
| 402 | |
| 403 | const handler = this.fsWatchHandler; |
| 404 | void handler.remove(sid, this.id, []).catch((err: unknown) => { |
| 405 | this.logger.warn( |
| 406 | { sid, err: String(err) }, |
| 407 | 'unsubscribe watch_fs drop threw', |
| 408 | ); |
| 409 | }); |
| 410 | } |
| 411 | } |
| 412 | this.send( |
| 413 | buildAck(msg.id, 0, 'success', { |
| 414 | accepted: session_ids, |
| 415 | not_found: [], |
| 416 | resync_required: [], |
| 417 | }), |
| 418 | ); |
| 419 | } |
| 420 | |
| 421 | private onWatchFsAdd(msg: WatchFsAddMessage): void { |
| 422 | if (this.fsWatchHandler === undefined) { |