Files
buzz/docs
Will Pfleger a406191694 Revert "feat(relay): support community-scoped NIP-AR artifacts" (#9689)
Reverts #9650 (squash commit `eebf62b6`), except for migration `0097`
and the channel artifact sync fences it added.

Community scope adds a relay access gate based on community admission
rather than channel membership, a new relay-admin command kind (`9034`)
and an operator-run key transition. Its design and NIP-AR text need
relay maintainer review before they ship. Two integration gaps also
remain:

- Media download authorization looks up references only in `events`, so
an attachment referenced only by a community artifact is unreadable when
media-read enforcement is on.
- User erasure retires a community head in the database without
signaling live syncs, so members who are already syncing keep the erased
copy.

The feature can return as a new PR once those are resolved.

## Kept from #9650

- **Migration `0097`, byte for byte.** Published images already include
it, and databases that auto-migrated have recorded it. Dropping it would
stop those relays from starting. It only adds columns and indexes that
the channel code ignores. The declared schema matches that expanded
shape and keeps the `(community_id, artifact_id)` primary key, so the
operator key transition no longer exists.
- **Channel artifact sync fences.** Snapshot and live sends check for a
pending resync and for connection cancellation under the queue lock. A
reader who loses access, or whose content is redacted, while a frame is
in flight therefore receives no further payload. Handler-backed tests
cover a resync recorded while a snapshot payload waits for queue room
and one recorded after a live head read.

## Compatibility

This revert supports databases that applied only migration `0097`, which
is all that auto-migration runs. A database that ran #9650's operator
contract script, or was bootstrapped from #9650's declared schema, has
no `(community_id, artifact_id)` key, so channel artifact writes fail
there. Before deploying to such a database, check that
`artifact_heads_pkey` is on `(community_id, artifact_id)` and that
`artifact_heads` has no rows with `scope = 'community'`; if either check
fails, it needs a separate recovery step.

---------

Signed-off-by: Will Pfleger <wpfleger@block.xyz>
Co-authored-by: Paul <4a1bfa0013bc6d14a8d600d8bf6392efefbd2a26ac3c96c9b2a106b0d12297ca@buzz.block.builderlab.xyz>
2026-11-19 02:38:17 +00:00
..