chadtmiller.com/pds.js
An atproto PDS in JavaScript, for Cloudflare Workers and Node
0
0
A space write answers before its notices go out
MergedMerged as a8d1361
An atproto PDS in JavaScript, for Cloudflare Workers and Node
What changes
A space write answers before its notices go out.
ExtensionHost.background(work)runs work after the response and logs any error from it. A platform passeswaitUntilto the server to keep itself running until that work ends.waitUntilis the Durable Object'sstate.waitUntil.background.outbox.deliversaves the notice first. Only its first try goes throughbackground, and a failed try is retried from the alarm as before.background, both run before the answer.NOTICE_TIMEOUT_MS). A notice to another space's owner that times out is retried.Why
knotless-serve's organization writes waited 1.7 to 2.7 s on each
space.applyWrites, measured from its outgoing-call trace in prod. The PDS awaited thenotifyWriteto knotless-serve, the space's syncer, before it answered. knotless-serve meanwhile was resolving a DID on plc.directory to check the notice. So one slow syncer made every write into the space as slow as itself, and with no timeout there was no limit on how slow.How it was checked
npm run cipasses: biome, both typechecks, and 3238 tests within the coverage floors.Shortcomings
manage.js's forwarding of a receivednotifyWriteto the syncers still runs before its answer. Its caller is another PDS's outbox, not a person waiting.🤖 Generated with Claude Code