~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/pds.js

An atproto PDS in JavaScript, for Cloudflare Workers and Node

0
0
main
20 lines · 866 B Raw History

'@pdsjs/core': patch '@pdsjs/cloudflare': patch '@pdsjs/storage-sqlite': patch

A commit deletes the blocks it leaves unreachable: the tree nodes it replaced, the records it replaced or deleted that no other record shares, and the previous commit, as the reference PDS does. Until now every block was kept, so a deleted record stayed in storage, readable by its CID to anything with the account's storage, extensions included.

com.atproto.sync.getRepo then reads the block table a page at a time and streams it, rather than walking the tree block by block and building the whole CAR first. The first getRepo after upgrading sweeps the blocks stored before, once, holding writes while it does. A rebuilt tree or an imported repo is swept the same way.

com.atproto.sync.getRecord sends the path from the root to the record, not every node of the tree.