mirror of
https://github.com/block/buzz.git
synced 2026-11-04 00:12:02 +00:00
The reaction onMutate snapshotted the cache and wrote the optimistic
kind:7 synchronously, but did not cancel an in-flight useChannelMessages
fetch first. That queryFn ends with setQueryData(queryKey, mergedHistory)
built from a pre-click snapshot, so a fetch resolving just after the
click would clobber the optimistic reaction until the next backfill —
the same race the sibling send-message onMutate already guards against.
Make onMutate async and await queryClient.cancelQueries({ queryKey })
before snapshotting, matching the send-message mutation. Narrow but real;
no behavior change when no fetch is in flight (cancelQueries is a no-op).
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