From e2b935e3221a1ff8b6a01ff2f27eb2456aa40b35 Mon Sep 17 00:00:00 2001 From: Takumi Akimoto Date: Sat, 2 May 2026 01:33:18 +0900 Subject: [PATCH] fix: Don't start Jetstream if there are no DIDs to subscribe --- service/jestream.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/service/jestream.ts b/service/jestream.ts index c798fbe..a0405fc 100644 --- a/service/jestream.ts +++ b/service/jestream.ts @@ -11,9 +11,11 @@ import { postMessage } from "../traq/index.ts" export class JetstreamService { private jetstream: Jetstream private cursor?: number + private readonly subscribingDids: string[] constructor(opts: { wantedDids: string[]; cursor?: number }) { this.cursor = opts.cursor + this.subscribingDids = opts.wantedDids this.jetstream = new Jetstream({ wantedDids: opts.wantedDids, cursor: opts.cursor, @@ -60,6 +62,11 @@ export class JetstreamService { } start() { + if (this.subscribingDids.length === 0) { + console.warn("No DIDs to subscribe. Jetstream will not start.") + return + } + this.jetstream.start() } -- 2.51.2