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),