Ionosphere.tv
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: seed known comment authors so backfill works after fresh DB

Comments are stored on users' PDSes, not the bot's PDS. After a DB
reset, the comment backfill had no known authors to query, so no
comments were recovered. Now seeds with known author DIDs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+15 -2
+15 -2
apps/ionosphere-appview/src/public-jetstream.ts
··· 60 60 } 61 61 62 62 /** 63 - * Backfill comments from DIDs that already have comments in the DB. 63 + * Backfill comments from known authors + any DIDs already in the DB. 64 64 * Fetches their tv.ionosphere.comment records directly from their PDS 65 65 * to catch anything the Jetstream missed. 66 + * 67 + * Seed DIDs ensure comments are recovered even after a fresh DB. 66 68 */ 69 + const SEED_COMMENT_AUTHORS = [ 70 + "did:plc:2zmxikig2sj7gqaezl5gntae", 71 + "did:plc:3vdrgzr2zybocs45yfhcr6ur", 72 + ]; 73 + 67 74 async function backfillComments(db: Database.Database): Promise<void> { 68 - const authors = db 75 + const dbAuthors = db 69 76 .prepare("SELECT DISTINCT author_did FROM comments") 70 77 .all() as { author_did: string }[]; 78 + 79 + const authorSet = new Set([ 80 + ...SEED_COMMENT_AUTHORS, 81 + ...dbAuthors.map((a) => a.author_did), 82 + ]); 83 + const authors = [...authorSet].map((did) => ({ author_did: did })); 71 84 72 85 if (authors.length === 0) return; 73 86