Skip to content

buzz-db: split channel.rs into channel CRUD + membership #7

Description

@TheSentinel454

Problem

channel.rs is 3,419 lines mixing two concerns backed by different database tables:

  • Channel CRUD (~1,200 lines, channels table): create_channel, get_channel, update_channel, archive_channel, list_channels, set_topic, set_purpose, etc.
  • Membership management (~1,500 lines, channel_members table): add_member, remove_member, is_member, get_members, get_accessible_channel_ids, lock_member_snapshot, get_member_role, advisory-lock helpers, roster fence verification

Plus ~700 lines of tests.

Proposed change

Split into:

  • channel.rs — channel CRUD, types (ChannelRecord, ChannelUpdate, AccessibleChannel), and channel-scoped queries
  • channel_members.rs — membership operations, types (MemberRecord, LockedMemberSnapshot, BotMemberRecord), advisory-lock helpers, roster fence verification

Priority

Medium — second-largest domain file with a clear natural seam at the table boundary.

🤖 AI review update (2026-08-23)

The seam is valid. Split channel CRUD from membership/roster locking as one self-contained #2 slice, moving the relevant tests and datastore spans in the same PR. Keep TTL/channel-lifecycle locking with the domain that owns its invariant rather than grouping solely by table name.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions