Files
buzz/crates
Matt Toohey 05d431094c fix(relay): join new members to every default channel, not the first 32
`list_auto_join_channels` stopped at 32 rows while kind:9002 kept accepting
`auto_join=true` on any number of channels, so with 33 flagged channels the
newest one carried the kind:39000 `auto_join` tag but no claim or kind:9030
add ever joined anyone to it, and nothing retried because the person was
already a relay member (Codex review on #8594).

Drop the cap rather than enforce it at flag time: the kind:9002 transaction
holds only the shared community admission lock and the one channel's row
lock, so a count-based refusal would need a new community-wide lock to be
race-free, and a private or archive flip on a flagged channel would still
let the stored count drift past it. The loader now returns every effective
channel, oldest first; the set is bounded by the community's channels, each
flagged by a relay owner or admin, and NOSTR.md says so.

Test: `every_default_channel_is_listed` (Postgres lane) flags 33 channels
and asserts the loader lists all of them in creation order; putting the
`LIMIT` back fails it (verified by mutation).

Verified: fmt; clippy -D warnings on buzz-db and buzz-relay (all targets);
the four auto_join Postgres tests. `auto_join_is_relay_admin_only_...`
failed once at its first query with the known `PoolTimedOut` lane flake and
passed on a solo rerun.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
2026-10-27 08:04:02 +11:00
..