| … | … | @@ -1,6 +1,6 @@ |
| 1 | 1 | { |
| 2 | 2 | "name": "atproto-bridge", |
| 3 | "version": "0.9.37", | |
| 3 | "version": "0.9.38", | |
| 4 | 4 | "description": "Stateless keyless atproto MEMBRANE \u2014 fronts self-custody hyper-proto-peers to bluesky over HTTP/WS, holds no keys and never signs. Bare-runnable. Deploy root / flat closure over the identity+repo+store+pds packages.", |
| 5 | 5 | "type": "module", |
| 6 | 6 | "main": "index.js", |
| … | … | @@ -216,7 +216,14 @@ export function createPdsServer ({ peers = null, serverDid = null, availableUser |
| 216 | 216 | case 'com.atproto.repo.listRecords': { |
| 217 | 217 | const front = await frontIfPeer(q.get('repo') || q.get('did') || undefined) |
| 218 | 218 | if (!front) return sendErr(res, 404, 'RepoNotFound', 'repo not fronted here') |
| 219 | return sendJson(res, 200, { records: await front.listRecords(q.get('collection')) }) | |
| 219 | // The lexicon's params were parsed by nobody: limit/reverse/cursor arrived here and were | |
| 220 | // dropped, so a paging client looped on a cursor that never advanced. `records` and | |
| 221 | // `cursor` are spread through verbatim — cursor absent means "last page". | |
| 222 | return sendJson(res, 200, await front.listRecords(q.get('collection'), { | |
| 223 | limit: q.get('limit') ? Number(q.get('limit')) : 50, | |
| 224 | reverse: q.get('reverse') === 'true', | |
| 225 | cursor: q.get('cursor') || null | |
| 226 | })) | |
| 220 | 227 | } |
| 221 | 228 | case 'com.atproto.repo.describeRepo': { |
| 222 | 229 | const front = await frontIfPeer(q.get('repo') || q.get('did') || undefined) |
| … | … | @@ -136,7 +136,14 @@ export function createPdsServer ({ peers = null, serverDid = null, availableUser |
| 136 | 136 | case 'com.atproto.repo.listRecords': { |
| 137 | 137 | const front = await frontIfPeer(q.get('repo') || q.get('did') || undefined) |
| 138 | 138 | if (!front) return sendErr(res, 404, 'RepoNotFound', 'repo not fronted here') |
| 139 | return sendJson(res, 200, { records: await front.listRecords(q.get('collection')) }) | |
| 139 | // The lexicon's params were parsed by nobody: limit/reverse/cursor arrived here and were | |
| 140 | // dropped, so a paging client looped on a cursor that never advanced. `records` and | |
| 141 | // `cursor` are spread through verbatim — cursor absent means "last page". | |
| 142 | return sendJson(res, 200, await front.listRecords(q.get('collection'), { | |
| 143 | limit: q.get('limit') ? Number(q.get('limit')) : 50, | |
| 144 | reverse: q.get('reverse') === 'true', | |
| 145 | cursor: q.get('cursor') || null | |
| 146 | })) | |
| 140 | 147 | } |
| 141 | 148 | case 'com.atproto.repo.describeRepo': { |
| 142 | 149 | const front = await frontIfPeer(q.get('repo') || q.get('did') || undefined) |
| … | … | @@ -98,7 +98,7 @@ test('bridge PeerFront serves a remote peer getRepo + subscribeRepos — KEYLESS |
| 98 | 98 | // keyless read surface (from the replicated repo/firehose) |
| 99 | 99 | const rec = await front.getRecord('app.bsky.feed.post', '3a') |
| 100 | 100 | t.is(rec && rec.value.text, 'fronted', 'getRecord returns the peer record') |
| 101 | const list = await front.listRecords('app.bsky.feed.post') | |
| 101 | const { records: list } = await front.listRecords('app.bsky.feed.post') | |
| 102 | 102 | t.ok(list.some(r => r.value.text === 'fronted'), 'listRecords includes the record') |
| 103 | 103 | const latest = await front.getLatestCommit() |
| 104 | 104 | t.ok(latest && latest.cid && latest.rev, 'getLatestCommit returns { cid, rev }') |
| … | … | @@ -61,7 +61,7 @@ test('peer RESTART (same keys) — front self-heals, new commit replicates witho |
| 61 | 61 | // corestore.replicate re-attaches them to a FRESH connection after a flaky-link drop (direction-free). |
| 62 | 62 | t.ok(front.seq.core.replicator && front.seq.core.replicator.downloading, 'FIX: firehose core is downloading (standing download)') |
| 63 | 63 | t.ok(front.repo.core.replicator && front.repo.core.replicator.downloading, 'FIX: repo core is downloading (standing download)') |
| 64 | const r1 = await front.listRecords('app.bsky.feed.post') | |
| 64 | const { records: r1 } = await front.listRecords('app.bsky.feed.post') | |
| 65 | 65 | t.is(r1.length, 1, 'baseline: front serves the pre-restart post') |
| 66 | 66 | |
| 67 | 67 | // --- RESTART the peer: swarm dies (process restart), recreate SAME keypair + SAME storage, rejoin --- |
| … | … | @@ -78,7 +78,7 @@ test('peer RESTART (same keys) — front self-heals, new commit replicates witho |
| 78 | 78 | // ASSERT: the front replicates the new commit within ~12s, WITHOUT re-creating the router. |
| 79 | 79 | let got = 0 |
| 80 | 80 | for (let i = 0; i < 60; i++) { |
| 81 | const recs = await front.listRecords('app.bsky.feed.post').catch(() => []) | |
| 81 | const recs = (await front.listRecords('app.bsky.feed.post').catch(() => ({ records: [] }))).records | |
| 82 | 82 | got = recs.length |
| 83 | 83 | if (got >= 2) break |
| 84 | 84 | await new Promise(r => setTimeout(r, 200)) |