CodeNomad/dev-docs
Pascal André 54958f4e83
fix(tauri): prevent Windows event-loop refcount corruption (#996)
## Summary

Fix repeated Windows heap-corruption crashes in the installed Tauri
build. The pinned runtime exposes clonable, thread-safe handles whose
unsafe context graph contains Tao's non-atomic `Rc<EventLoopRunner>`.
IPC-worker clone/drop traffic races the event loop's reference count and
can free the runner prematurely.

- Use `Arc` for that internal Windows runner counter, retaining
main-thread confinement of runner state and the target's existing public
threading contract.
- Add an isolated regression using the real pinned Wry runtime's public
handle API, with a negative control that reverses only this counter in a
temporary crate copy.
- Add the Windows regression to CI and document the captured failures,
compatibility rationale and removal criteria.

This is a local compatibility correction for the runtime CodeNomad
ships. [tao#1290](https://github.com/tauri-apps/tao/pull/1290) proposed
the same counter change but was closed **without merging**, because the
underlying contract violation is Tauri moving/cloning the non-Send
target. That distinction is recorded explicitly. Related reports:
[tauri#15408](https://github.com/tauri-apps/tauri/issues/15408) and
[tauri#15793](https://github.com/tauri-apps/tauri/issues/15793).

## Validation

- `node scripts/test-tauri-runner-refcount.mjs --baseline`: **9 native
crashes / 10 negative-control processes; 5 / 5 corrected passes**,
800,000 handle clones plus teardown per process.
- `node scripts/test-tauri-input-deadlock.mjs --baseline`: keydown,
keyup, char, syschar, IME and instrumented IME-boundary checks pass; the
original/reverted negative controls reproduce their expected deadlocks.
- `cargo build --locked --release -p codenomad-tauri`: passes.
- `rustfmt --check` on the new fixture and `node --check` on its runner:
pass.
- Corrected release executable installed locally on the affected Windows
machine, retaining the existing resources and updater verification
public key; original executable and matching new symbols archived
locally.

The runtime reproduction needs no JavaScript or web page. The Virtua
0.53.5 upgrade is absent from the crashing `3394fc7f` build. Sustained
application use remains additional validation beyond the bounded native
regression.
2026-10-18 02:07:17 +02:00
..
architecture.md fix(sidecars): isolate application cookies from upstream services (#995) 2026-10-18 00:28:05 +02:00
BROWSER_AUTOMATION.md fix(browser): share cookies and site storage across session tabs (#898) 2026-10-09 18:53:50 +02:00
BROWSER_DEVICE_EMULATION.md fix(layout): make desktop minimums zoom-aware and compact headers at 420px (#817) 2026-10-01 12:44:01 +02:00
CACHE_REFRESH_CONVENTIONS.md fix(pending): stop Git process fans from starving pending-request recovery (#909) 2026-10-10 23:58:27 +02:00
DESKTOP_DATA_PROFILES.md feat(missions): native project coordination, briefings and tracking (#866) 2026-10-11 14:55:49 +02:00
DEVELOPER_MODE.md feat(remote-control): add Remote Control over OpenTunnel alongside direct access (#668) 2026-10-09 12:43:25 +02:00
FILES_PANEL.md feat(files): hide whitespace-only changes (Advanced setting, on by default) (#934) 2026-10-13 04:05:50 +02:00
HOTKEYS.md refactor(settings): limit the shortcut manager to renderer shortcuts 2026-10-13 22:06:10 +02:00
INDEX.md docs(help): multilingual help site with in-app Help menu and palette entry (#859) 2026-10-14 22:44:56 +02:00
MISSIONS.md feat(missions): add a Product delivery playbook based on NomadWorks (#946) 2026-10-14 14:45:38 +02:00
MISSIONS_AUTONOMOUS_PLUGIN_REQUIREMENTS.md feat(missions): native project coordination, briefings and tracking (#866) 2026-10-11 14:55:49 +02:00
MISSIONS_CONTINUITY_CONTRACT.md feat(missions): native project coordination, briefings and tracking (#866) 2026-10-11 14:55:49 +02:00
MISSIONS_ENVIRONMENT_ADMISSION.md feat(missions): native project coordination, briefings and tracking (#866) 2026-10-11 14:55:49 +02:00
MISSIONS_FAMILY_AUTHORITY.md feat(missions): native project coordination, briefings and tracking (#866) 2026-10-11 14:55:49 +02:00
MISSIONS_HUMAN_ANSWER_RECEIPTS.md feat(missions): native project coordination, briefings and tracking (#866) 2026-10-11 14:55:49 +02:00
MISSIONS_NATIVE_PRODUCT_ACCEPTANCE.md feat(missions): native project coordination, briefings and tracking (#866) 2026-10-11 14:55:49 +02:00
MISSIONS_RECURRING_SIMPLE.md feat(missions): native project coordination, briefings and tracking (#866) 2026-10-11 14:55:49 +02:00
MISSIONS_RECURRING_SIMPLE_QUALIFICATION.md feat(missions): native project coordination, briefings and tracking (#866) 2026-10-11 14:55:49 +02:00
MISSIONS_REFACTOR_VALIDATION.md feat(missions): native project coordination, briefings and tracking (#866) 2026-10-11 14:55:49 +02:00
MISSIONS_SESSION_RECOVERY.md feat(missions): native project coordination, briefings and tracking (#866) 2026-10-11 14:55:49 +02:00
MISSIONS_WATCHED_SOURCES.md feat(missions): native project coordination, briefings and tracking (#866) 2026-10-11 14:55:49 +02:00
NATIVE_INTERRUPTION_UX.md fix(chat): keep request icons and show complete red badges (#871) 2026-10-07 14:22:55 +02:00
OPENCODE_V2_COMPATIBILITY.md fix(pending): recover requests in nested checkouts the workspace already owns (#964) 2026-10-15 09:15:42 +02:00
OPENCODE_V2_POST_BETA.md fix(opencode-setup): offer OpenCode 2 when an old or foreign OpenCode blocks setup (#982) 2026-10-16 15:44:17 +02:00
PALETTE_SOURCES.md V2(ui): progressively harmonize the CodeNomad interface (#667) 2026-09-15 14:17:30 +01:00
PANEL_EXTENSIONS.md feat(ui): assign backgrounds by surface role and harmonize menus (#914) 2026-10-12 11:12:37 +02:00
PLUGIN_ACTIVATION_CONTROLS.md feat(plugins): add scoped V2 plugin activation controls (#726) 2026-09-25 01:29:14 +02:00
PROVIDER_ACCOUNTS_UX_PLAN.md feat(accounts): rotate subscription accounts across providers, including OpenCode Go (#924) 2026-10-12 19:13:06 +02:00
REMOTE_CONTROL.md feat(remote-servers): pair a desktop window through a Remote Control link (#928) 2026-10-13 02:20:37 +02:00
RUNTIME_MAINTENANCE.md ci: refresh actions and monitor the bundled Node/npm runtime 2026-10-14 10:36:24 +02:00
SESSION_ENVIRONMENT.md feat(missions): native project coordination, briefings and tracking (#866) 2026-10-11 14:55:49 +02:00
SESSION_HISTORY_NAVIGATION.md refactor(chat): render the transcript header as Virtua's first row (#992) 2026-10-17 16:58:26 +02:00
SESSION_HISTORY_QUERIES.md feat(history): name the conversation and worktree of workspace search results (#993) 2026-10-17 16:02:16 +02:00
SESSION_PRUNING_RPC.md docs: prune obsolete specifications and development readouts 2026-10-08 00:42:53 +02:00
SESSION_PRUNING_SAFETY.md feat(pruning): restore opt-in selective deletion through native plugin RPC (#686) 2026-09-10 13:31:40 +02:00
solidjs-llms.txt update blank session cleanup code for now session store logic 2025-11-27 20:18:22 -05:00
TAURI_UPDATER.md build: ship the Linux deb from Electron and the Windows installer without a ZIP (#955) 2026-10-14 16:45:49 +02:00
TAURI_WINDOWS_RUNNER_REFCOUNT.md fix(tauri): prevent Windows event-loop refcount corruption (#996) 2026-10-18 02:07:17 +02:00
USER_HELP.md docs(help): multilingual help site with in-app Help menu and palette entry (#859) 2026-10-14 22:44:56 +02:00
WORKTREE_SESSION_PLACEMENT.md docs: prune obsolete specifications and development readouts 2026-10-08 00:42:53 +02:00