Files
buzz/desktop
Matt Toohey cbd45a6088 fix(desktop): survive unmounted editor views and listener teardown races
Two pre-existing crashes surfaced in the dev console, both independent of
the projects work on this branch.

SelectionFormattingTray read `editor.view.dom` on mount. A tiptap v3 Editor
outlives its ProseMirror view, and while the view is detached `editor.view`
is a proxy that throws for every key it does not stub. When React reconnected
the effect for a hidden composer subtree the view was already torn down, so
the read threw, crashed the component, and escaped to the router's root catch
boundary. Track the mounted view as state synced from tiptap's mount/unmount
events, and route every view access through a `getMountedView` guard.

The huddle listeners called Tauri's unlisten function directly. `listen()`
resolves with its event id as soon as the backend command returns, but the
backend publishes that id into the webview through a separate eval, so an
unlisten issued in that gap throws from `unregisterListener` before it reaches
`plugin:event|unlisten`. That left the backend listener registered and still
firing its handler after unmount, on top of the unhandled rejection. Add
`safeUnlisten`, which retries with backoff until the teardown actually lands.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
2026-08-25 16:45:27 +10:00
..
…

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 frontend
  • pnpm tauri dev - run the desktop app
  • pnpm build - typecheck and build frontend
  • pnpm typecheck - TypeScript checks
  • pnpm lint - Biome lint
  • pnpm 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