[PR #3165] [MERGED] fix(electron): attach error listener to spawned node process in readiness fixture #5651

Closed
opened 2026-10-31 01:08:17 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3165
Author: @qorvr
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @morluto

Base: main ← Head: fix/electron-readiness-spawn-error


📝 Commits (1)

  • d732bae fix(electron): attach error listener to spawned node process in readiness fixture

📊 Changes

1 file changed (+2 additions, -1 deletions)

View changed files

📝 tests/conformance/readiness/electron/main.js (+2 -1)

📄 Description

Summary

In tests/conformance/readiness/electron/main.js, spawn() is invoked with process.env.REA_ELECTRON_NODE_EXECUTABLE ?? "node". If the node executable is unavailable on PATH or in custom verification environments, Node's ChildProcess emits an error event. Without an explicit "error" event listener, Node throws an unhandled exception that prematurely crashes the Electron fixture.

Evaluated and error found by SubQ by Qorvr.

Problem and expected behavior

  • Smallest trigger: Running Electron readiness verification in environments without a node binary on PATH, or with an invalid REA_ELECTRON_NODE_EXECUTABLE.
  • Observed failure: Unhandled 'error' event emitted by child_process.spawn() terminates the test runner process.
  • Expected behavior: Child process spawn errors should be absorbed gracefully with an error listener, matching the existing shell.openExternal(...).catch(() => undefined) error boundary on line 35.

Change and scope

  • Attached child.on("error", () => undefined); immediately after spawning the background helper process.

Contract and boundary impact

  • Semantic owner and earliest changed stage: tests/conformance/readiness/electron/main.js.
  • Contribution scope fit and linked maintainer decision: not applicable (test fixture resilience fix).
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: improves electron readiness test reliability across CI/local containers.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): none.
  • Generated metadata impact: none.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: tests/conformance/readiness/electron/main.js.
  • Base reproduction or other evidence: Spawning an invalid executable emits an unhandled 'error' event.
  • Remaining proof gaps: none.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run format:check — oxfmt passed on all files.
  • npm run lint — oxlint passed with 0 errors; module boundary checks passed.
  • turbo run typecheck lint — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: cross-platform safe.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: safe error handler.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/3165 **Author:** [@qorvr](https://github.com/qorvr) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/electron-readiness-spawn-error` --- ### 📝 Commits (1) - [`d732bae`](https://github.com/morluto/rea/commit/d732baeaf0523da65f9487957287af5be8a58007) fix(electron): attach error listener to spawned node process in readiness fixture ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/conformance/readiness/electron/main.js` (+2 -1) </details> ### 📄 Description ## Summary In `tests/conformance/readiness/electron/main.js`, `spawn()` is invoked with `process.env.REA_ELECTRON_NODE_EXECUTABLE ?? "node"`. If the node executable is unavailable on PATH or in custom verification environments, Node's `ChildProcess` emits an `error` event. Without an explicit `"error"` event listener, Node throws an unhandled exception that prematurely crashes the Electron fixture. Evaluated and error found by SubQ by Qorvr. ## Problem and expected behavior - **Smallest trigger:** Running Electron readiness verification in environments without a node binary on PATH, or with an invalid `REA_ELECTRON_NODE_EXECUTABLE`. - **Observed failure:** Unhandled `'error'` event emitted by `child_process.spawn()` terminates the test runner process. - **Expected behavior:** Child process spawn errors should be absorbed gracefully with an error listener, matching the existing `shell.openExternal(...).catch(() => undefined)` error boundary on line 35. ## Change and scope - Attached `child.on("error", () => undefined);` immediately after spawning the background helper process. ## Contract and boundary impact - Semantic owner and earliest changed stage: `tests/conformance/readiness/electron/main.js`. - Contribution scope fit and linked maintainer decision: not applicable (test fixture resilience fix). - CLI and MCP/tool-catalog contract: none. - Provider, bridge, target-format, or platform compatibility: improves electron readiness test reliability across CI/local containers. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): none. - Generated metadata impact: none. Expected effects: - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `tests/conformance/readiness/electron/main.js`. - Base reproduction or other evidence: Spawning an invalid executable emits an unhandled `'error'` event. - Remaining proof gaps: none. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run format:check` — oxfmt passed on all files. - `npm run lint` — oxlint passed with 0 errors; module boundary checks passed. - `turbo run typecheck lint` — passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: cross-platform safe. - Package or release metadata impact: none. - Security, privacy, process, or containment review: safe error handler. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:08:17 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5651
No description provided.