Files
buzz/desktop
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 f95b7aec08 fix(relay): allow owner-of-agent to delete agent messages, surface delete errors in desktop
The desktop grants the delete button to self-author OR owner-of-agent via
`canManageMessage`, but the relay's kind:5 validator only honored self-author.
An owner deleting their agent's message received a silent relay rejection
because `useDeleteMessageMutation` had no `onError` handler.

Relay (validate_standard_deletion_event, side_effects.rs):
- e-tag branch: when target_author != actor, fall through to is_agent_owner
  before rejecting. If owner, re-gate on channel membership so a removed
  private-channel member cannot delete their agent's historic messages after
  access is revoked. Open channels pass without membership. Mirrors the
  membership re-gate from validate_edit_ownership.
- a-tag branch: same is_agent_owner fallback. Membership re-gate applies when
  the deletion event carries a resolvable h-tag channel context; global
  addressable events (no channel context) pass on owner-check alone.
- Self-author fast-path unchanged: no membership re-gate on delete.

Desktop (hooks.ts):
- Add onError to useDeleteMessageMutation that surfaces a toast so relay
  rejections are visible rather than silently swallowed.

Tests (side_effects.rs): five DB-backed integration tests with graceful-skip
when DATABASE_URL is unavailable:
- delete_own_message_succeeds
- delete_owner_agent_message_as_member_succeeds
- delete_non_owner_agent_message_is_rejected
- delete_owner_agent_message_removed_from_private_channel_is_rejected
- delete_owner_agent_message_in_open_channel_without_membership_succeeds

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-07-02 19:54:01 -04:00
..
2026-07-02 16:26:31 -07:00
2026-07-02 16:26:31 -07:00
2026-06-11 15:06:24 +00:00
2026-06-11 15:06:24 +00:00

Buzz

Desktop chat shell with:

  • Tauri + React + TypeScript + Vite
  • Tailwind CSS
  • shadcn/ui-ready shared components
  • Biome (lint/format/check)
  • Feature-driven frontend structure

Scripts

  • pnpm dev - run the web frontend
  • pnpm tauri dev - run the desktop app
  • pnpm build - typecheck and build frontend
  • pnpm typecheck - TypeScript checks
  • pnpm lint - Biome lint
  • pnpm format - Biome format (write)
  • pnpm check - Biome check

Structure

  • src/shared - reusable app-wide code (ui, lib, styles)
  • src/features - feature modules (vertical slices)
  • src/app - top-level app composition