mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Every reply paid a full relay round trip before send: resolve_thread_ref fetched the parent event just to walk its NIP-10 e-tags for the thread root — data the frontend timeline cache almost always already has. send_channel_message grows an optional cached_root_event_id. The TS send mutation resolves the root from the cached timeline via a new resolveCachedReplyRoot that mirrors the Rust resolver exactly (last root marker wins, else last reply marker, else parent is root; same parent-kind allowlist including KIND_HUDDLE_STARTED=48100; self-referential markers collapse to the parent). Any cache miss or out-of-allowlist kind returns null and the Rust side falls back to the existing relay resolution — behavior unchanged. Correctness: the cached root is used only for tag construction; the relay's ingest-side ancestry validation (root tag must match thread ancestry) still rejects any stale/wrong root, so the fast path cannot produce an accepted-but-misthreaded event. A unit suite pins the TS mirror to the Rust resolver semantics, including the trap where resolveReplyRootId's parent-id fallback would mislabel a nested reply as a thread root. Co-authored-by: Tyler Longwell <tlongwell@block.xyz> Signed-off-by: Tyler Longwell <tlongwell@block.xyz>
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