Skip to content

perf: persist workspace session patches - #3963

Merged
nwparker merged 2 commits into
mainfrom
nwparker/clean-state
May 31, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/clean-state

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

  • persist debounced workspace session updates as top-level patches instead of full snapshots
  • add main-process patch fast path while preserving full terminal normalization for structural patches
  • let remote workspace sync export from the persisted store session after the local patch lands

Tests

  • pnpm vitest run --config config/vitest.config.ts src/renderer/src/lib/session-write-subscriber.test.ts src/renderer/src/lib/workspace-session.test.ts src/renderer/src/lib/workspace-session-patch.test.ts src/main/persistence.test.ts src/main/ipc/remote-workspace.test.ts
  • pnpm run typecheck:node
  • pnpm run typecheck:web
  • pnpm run typecheck:cli
  • pnpm run lint

@nwparker nwparker closed this May 31, 2026
@nwparker
nwparker deleted the nwparker/clean-state branch May 31, 2026 00:25
@nwparker nwparker reopened this May 31, 2026
@nwparker
nwparker merged commit f696dfb into main May 31, 2026
1 check passed
@nwparker nwparker added the risk:high High risk change label May 31, 2026
nwparker added a commit that referenced this pull request Jul 14, 2026
#185 ref loop

radix-ui 1.4.3 bundles pre-fix sub-packages (react-slot 1.2.3, react-popper
1.2.8, react-compose-refs 1.1.2, react-menu/dropdown-menu 2.1.16) that build a
new composed callback-ref identity every render. Under React 19's re-run-on-
identity-change ref semantics, that detaches/re-attaches the ref each commit;
several primitives compose a useState setter as that ref (Tooltip
onTriggerChange, Popper onAnchorChange), so the state oscillates null<->node
and after >50 nested updates React throws #185 (Maximum update depth exceeded).
Crash e95669d2 (Tooltip->Button) and the dev DropdownMenu->Button reports.

1.6.2 bundles the fixed sub-packages (react-slot 1.3.0 memoized compose-refs,
react-popper 1.3.3, react-compose-refs 1.1.3, react-menu/dropdown-menu 2.1.20,
react-tooltip 1.2.12). Upstream radix-ui/primitives #3799 + #3963.

Also batches React-runtime patch bumps (in-range 19.2.x, low risk):
react/react-dom 19.2.5->19.2.7, @types/react 19.2.14->19.2.17.

Evidence: Orca's real Tooltip+Button tree fires the button ref 2 attaches + 1
detach on a static mount with 1.4.3 (churn), and 1 attach + 0 detach with 1.6.2
(stable). Renderer suite (13703 tests) + web typecheck green on the combined bump.

Co-authored-by: Orca <[email protected]>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high High risk change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant