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

chadtmiller.com/pds.js

An atproto PDS in JavaScript, for Cloudflare Workers and Node

0
0

listSpaces leaves out deleted spaces, as the reference PDS does

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/pds.js:spaces/list-skips-deleted

What changes

com.atproto.space.listSpaces leaves out deleted spaces, as the reference PDS does (its reader filters deletedAt is null).

Storage listSpaces takes excludeDeleted. Each adapter (memory, sqlite, Cloudflare) filters on it in the query, so limit and the cursor count only the spaces returned. The XRPC handler sets it. The account page's space browser calls storage without it, so it still lists deleted spaces, marked deleted.

Why

deleteSpace marks a space deleted and keeps its row, and listSpaces listed it all the same. knotless's ls finds an account's private repositories through listSpaces, so it kept listing ones deleted long before: at://did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzclmohjg62b.

How it was checked

New tests: the storage conformance suite, which all three adapters run, has a deleted space listed without the option and left out with it, and the route tests have listSpaces leaving out a space deleted after a write to it. Not run locally. CI runs them.

🤖 Generated with Claude Code

Approved

This adds an excludeDeleted option to storage listSpaces. The memory, sqlite and Cloudflare adapters apply it in the query (memory in its filter), so limit and the cursor count only the spaces returned. The listSpaces XRPC handler sets it. I found no problems. The deleted_at / deletedAt names match what deleteSpace writes, and the default of false leaves the account page's space browser unchanged. The new tests cover the option in the shared conformance suite and the route, and the changeset is included. I didn't read AGENTS.md (the tool errored) or the CI results.

Approved

This still adds excludeDeleted to storage listSpaces. The memory, sqlite and Cloudflare adapters filter on it in the query, and the XRPC handler sets it. The only change since my last review is a formatting commit on the conformance test, which changes nothing in behavior. The tests and the changeset are in place. I found no problems.

Merged as bb39991