mirror of
https://github.com/block/buzz.git
synced 2026-11-30 13:12:38 +00:00
apply_workspace previously called mark_unready() then relied on spawn_event_sync's inner claim_in_progress() CAS to reclaim InProgress before migration and reconcile ran. The flush loop (alive since process start) could win that CAS in the window between mark_unready() and the spawn, certifying readiness against pre-migration, pre-reconcile DB state. Two consequences: reconcile silently dropped (spawn_event_sync returns early on failed CAS), and legacy migration rows published unarbitrated. Fixes: PRIMARY: apply_workspace now calls force_claim_in_progress() atomically BEFORE migrate_legacy_retention_into. The claim (an RAII ReadinessClaim guard) is held across the entire sequence: legacy migration -> reconcile -> barrier -> mark_ready/Unready. spawn_event_sync_with_held_claim takes the held claim instead of racing its own CAS. flush loop sees InProgress throughout and cannot interleave. SECONDARY: ReadinessClaim RAII guard replaces the manual mark_unready/ mark_ready calls at barrier entry/exit sites. On success, claim.resolve() prevents the drop from resetting to Unready; on error or panic, the drop resets to Unready automatically. A panic inside run_boot_barrier_for_scope no longer leaves the latch permanently wedged at InProgress. API changes: - claim_in_progress() returns Option<ReadinessClaim> (was bool) - force_claim_in_progress() added: preempting, any-state -> InProgress - ReadinessClaim: RAII guard with resolve() explicit success path - run_boot_barrier_after_claim() takes ReadinessClaim (transfers ownership) - spawn_event_sync removed (dead code); spawn_event_sync_with_held_claim is now the sole spawn entry point New test (f): apply_workspace window -- force_claim preempts any state; flush claim between invalidation and reconcile is rejected; migrated and reconciled rows gated by post-reconcile barrier cannot publish. 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