mirror of
https://github.com/block/buzz.git
synced 2026-11-01 06:51:17 +00:00
The rebase boundary was requiredNextGen >= MAX_SAFE_INTEGER (one notch), which
left a one-click cliff: a valid blob {pi.gen: MAX-2, ng: MAX-2} would hydrate
with nextGen=MAX-1, click 1 minted MAX (safe, persisted), and click 2 threw
synchronously up markChannelRead/markChannelUnread.
Add GEN_REBASE_HEADROOM = 2**32 (~4.3e9). Rebase now fires when requiredNextGen
>= MAX_SAFE_INTEGER - GEN_REBASE_HEADROOM, guaranteeing at least GEN_REBASE_HEADROOM
allocations succeed after any hydration. allocateGeneration()'s throw is
unreachable from any valid persisted state and remains defense-in-depth only.
Restructure drainPendingIntents so the finally block clears drainScheduled
unconditionally, and the success-path bookkeeping (counter reset + pendingFreshDrain
chaining) runs AFTER the try/finally block. Previously the success path set
drainScheduled=true for the chained drain inside the try, then the finally
overwrote it with false, silently cancelling the chained drain's guard.
Update Test 60 to use the MAX-2 starting state (Paul's exact repro). Add
Test 62 as the control witness: a normal blob (gen=1000, ng=1001) hydrates
verbatim with no rebase, proving the headroom trigger does not fire on healthy
state.
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