mirror of
https://github.com/block/buzz.git
synced 2026-11-03 07:51:22 +00:00
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>
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 frontendpnpm tauri dev- run the desktop apppnpm build- typecheck and build frontendpnpm typecheck- TypeScript checkspnpm lint- Biome lintpnpm 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