From 8f2ce329a31eeff3e0a4ec099744e95cbeecc9b4 Mon Sep 17 00:00:00 2001 From: "nekomimi.pet" Date: Sun, 4 Oct 2026 00:02:49 -0400 Subject: [PATCH] fix(preview-bot): read listRecords data so existing comments are updated, not duplicated --- apps/preview-bot/src/ports-http.test.ts | 3 ++- apps/preview-bot/src/ports-http.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/preview-bot/src/ports-http.test.ts b/apps/preview-bot/src/ports-http.test.ts index 3402fe4..a83995f 100644 --- a/apps/preview-bot/src/ports-http.test.ts +++ b/apps/preview-bot/src/ports-http.test.ts @@ -271,7 +271,8 @@ describe('bot comments', () => { const repo = { createRecord: async (input: Json) => calls.push({ op: 'create', input }), putRecord: async (input: Json) => calls.push({ op: 'put', input }), - listRecords: async () => ({ records: existing }), + // @atproto/api answers with the XRPC body under `data`. + listRecords: async () => ({ data: { records: existing } }), } return { agent: { com: { atproto: { repo } } }, calls } } diff --git a/apps/preview-bot/src/ports-http.ts b/apps/preview-bot/src/ports-http.ts index 2977443..691d77f 100644 --- a/apps/preview-bot/src/ports-http.ts +++ b/apps/preview-bot/src/ports-http.ts @@ -236,7 +236,7 @@ export function createHttpPorts(options: HttpPortsOptions): Ports { let cursor: string | undefined let count = 0 while (count < 1000) { - const page = await repo().listRecords({ + const { data: page } = await repo().listRecords({ repo: options.bot.did, collection: 'sh.tangled.feed.comment', limit: Math.min(100, 1000 - count), -- 2.54.0