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

A blob only a space holds is not served by the public repo's sync

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:host/public-blobs

What changes

com.atproto.sync.getBlob serves a blob only when a record in the account's public repo holds it. A blob held only by records in spaces answers BlobNotFound there, as an upload no record took already did; it is read through com.atproto.space.getBlob, or the console's /img, by those who may read the space. listBlobs already listed only the public repo's blobs, and now the test says so.

Why

sync.getBlob asks no one who they are, and answered any blob the account held but a leftover upload: a members-only group's avatar, or a photo in a private space, to anyone with its CID, which the records carry. /img and space.getBlob already checked the reader with held_publicly and the space's access; sync now holds to the first of those. The space alpha's PDS made the same change to its own sync.getBlob.

Imports are unaffected: they list a PDS's blobs with listBlobs before fetching each, and a move reads space blobs through com.atproto.space.getBlob.

How it was checked

  • tests/group_config.rs, shows_an_image_to_whoever_may_see_a_record_that_holds_it: an avatar held only in the members-only meta space is refused by sync.getBlob with BlobNotFound and missing from listBlobs; a photo in the public repo is served. It failed before the change (200) and passes after.
  • tests/blobs.rs and tests/group_config.rs pass; clippy is clean. The coverage gate is left to CI.

Shortcomings

A blob held both publicly and in a space is served by sync, as its public record already shows its CID to everyone.

🤖 Generated with Claude Code

Approved

sync.getBlob now serves a blob only when held_publicly finds a record in the public repo holding it. A blob held only in spaces gets BlobNotFound, the same as an upload no record took. The check is the one may_see already uses for /img and space.getBlob, so the three paths agree. The test covers the members-only avatar being refused and absent from listBlobs, and a public photo still being served. The change also updates the design page and api.md, as AGENTS.md asks. I found nothing to change.

I did not read the other sync.getBlob callers in import.rs in full. The import path lists blobs with listBlobs first, so it fetches only public blobs, as the body says.

Merged as f843a1b