mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Fetch persona catalog pages through the shared native relay session, verify relay events outside the renderer, preserve NIP-33 head and parser trust semantics (claim precedes shared gate precedes parse), and return one projected DTO across IPC. Keep only catalog-to-local-persona linkage in TypeScript. Signature verification measured at ~473us/event; a full 500-event page cost ~0.24s on the webview thread before this change, so verification runs under spawn_blocking. Finite catalog requests use fresh subscription ids alongside archive subscriptions on the same authenticated socket, fulfilled through the request map. Persistent archive events route directly through one bounded mpsc channel and the send is awaited in the socket loop: archive subscriptions are live-only (limit 0), so replay cannot repair eviction, and throttling a slow consumer preserves the no-loss contract. A slow archive consumer may therefore throttle a concurrent catalog fetch on the shared socket; that is deliberate and preferable to an unrecoverable archive gap. The awaited send sits outside the session-cancel select; teardown relies on run_sync dropping its receiver on its own cancel path. The catalog intentionally verifies finite events twice: transport verification bounds memory against forged input, while catalog verification keeps the projection helper sound for every caller. The 2x ~473us/event cost is deliberate. Real-WebSocket coverage proves request EVENT/EOSE/CLOSE flow, forged-event rejection, continued persistent delivery, and backpressure without loss under a slow-consumer burst (fast and slow arms, 1200/1200 each, plus post-burst delivery). Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.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