[GH-ISSUE #4593] [Bug] Verify runtime-dependent once dispatch in the Electron IPC hook #2383

Closed
opened 2026-10-17 21:03:59 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @N0zoM1z0 on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/4593

Before submitting

  • I searched open and closed issues for a related report.
  • I removed credentials and sensitive target data.

Area

Process capture or runtime observation

Observed behavior

Source/review finding, not an independently reproduced runtime bug. Greptile's review reports that Node24.21.0 native EventEmitter.once does not read callback .call/.apply, while REA's wrapper does. A callback with listener.apply = () => undefined could therefore be skipped by the hook while an invocation is recorded.

The producing code is already in main from #4389 (bf3475867ff136b9fbdbadd37ba01a4f3c642a74), unchanged by the six-file synchronous-shell PR #4562. Exact source. This is distinct from raw .listener mutation #4513.

Reproduction

NOT_ENOUGH_INFO: the claimed Node24.21.0 comparison has not been independently run. Existing pinned Node24.18.0 controlled regression coverage passed (73 IPC/hook cases before the new shell case); that does not establish behavior on every supported runtime. No real app callback loss or performance delta is claimed.

Proposed check: run the same callback/property descriptors and argument counts against native and hooked emitters on the reported runtime, pinned runtime and actual Electron44.7.0 Node runtime; preserve callback trace, metadata, native control and retained observation gaps. If confirmed, fix dispatch ownership instead of hardcoding a Node version or weakening tests, then verify with real application workflows.

Expected behavior

The active observation hook preserves the actual runtime's callback dispatch and records only execution it can establish. Native behavior remains authoritative across supported Node/Electron runtimes.

Impact and scope

Potential lost callback/evidence-integrity issue. NOT_ENOUGH_INFO for affected runtime range, frequency and real application impact. High priority to verify because this follows our merged IPC correctness work.

REA version

Main 61e688070f48016b6d178cd04c02fcc2f33e19ad; inherited listener implementation from #4389.

Runtime and platform

Own existing checks: Linux x64, pinned Node24.18.0; real Joplin/draw.io used generic Electron44.7.0 for their documented operation probes. Reported Node24.21.0 behavior is unverified here.

Target and artifact context

Main-process Electron IPC listener observation; proposed real-app verification must use shipped applications, not claim a controlled EventEmitter case is real-provider proof.

Interface

Other — shared CLI/MCP producing hook

Earliest failure stage

Capture or observation (suspected)

Relevant output or evidence

Review and source links above; source attribution was checked with an empty current-main vs PR-head diff for scripts/electron-active-hook.cjs. Runtime comparison and completed-task token/latency/CPU/memory evidence: NOT_ENOUGH_INFO; pending verification.

Originally created by @N0zoM1z0 on GitHub (Oct 16, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4593 ### Before submitting - [x] I searched open and closed issues for a related report. - [x] I removed credentials and sensitive target data. ### Area Process capture or runtime observation ### Observed behavior **Source/review finding, not an independently reproduced runtime bug.** [Greptile's review](https://github.com/morluto/rea/pull/4562#discussion_r4299282148) reports that Node24.21.0 native `EventEmitter.once` does not read callback `.call`/`.apply`, while REA's wrapper does. A callback with `listener.apply = () => undefined` could therefore be skipped by the hook while an invocation is recorded. The producing code is already in main from #4389 (`bf3475867ff136b9fbdbadd37ba01a4f3c642a74`), unchanged by the six-file synchronous-shell PR #4562. [Exact source](https://github.com/morluto/rea/blob/61e688070f48016b6d178cd04c02fcc2f33e19ad/scripts/electron-active-hook.cjs#L550). This is distinct from raw `.listener` mutation #4513. ### Reproduction NOT_ENOUGH_INFO: the claimed Node24.21.0 comparison has not been independently run. Existing pinned Node24.18.0 controlled regression coverage passed (73 IPC/hook cases before the new shell case); that does not establish behavior on every supported runtime. No real app callback loss or performance delta is claimed. Proposed check: run the same callback/property descriptors and argument counts against native and hooked emitters on the reported runtime, pinned runtime and actual Electron44.7.0 Node runtime; preserve callback trace, metadata, native control and retained observation gaps. If confirmed, fix dispatch ownership instead of hardcoding a Node version or weakening tests, then verify with real application workflows. ### Expected behavior The active observation hook preserves the actual runtime's callback dispatch and records only execution it can establish. Native behavior remains authoritative across supported Node/Electron runtimes. ### Impact and scope Potential lost callback/evidence-integrity issue. NOT_ENOUGH_INFO for affected runtime range, frequency and real application impact. High priority to verify because this follows our merged IPC correctness work. ### REA version Main `61e688070f48016b6d178cd04c02fcc2f33e19ad`; inherited listener implementation from #4389. ### Runtime and platform Own existing checks: Linux x64, pinned Node24.18.0; real Joplin/draw.io used generic Electron44.7.0 for their documented operation probes. Reported Node24.21.0 behavior is unverified here. ### Target and artifact context Main-process Electron IPC listener observation; proposed real-app verification must use shipped applications, not claim a controlled EventEmitter case is real-provider proof. ### Interface Other — shared CLI/MCP producing hook ### Earliest failure stage Capture or observation (suspected) ### Relevant output or evidence Review and source links above; source attribution was checked with an empty current-main vs PR-head diff for `scripts/electron-active-hook.cjs`. Runtime comparison and completed-task token/latency/CPU/memory evidence: NOT_ENOUGH_INFO; pending verification.
bsakaguchi 2026-10-17 21:03:59 +00:00
  • closed this issue
  • added the
    triage
    bug
    labels
Author
Owner

@N0zoM1z0 commented on GitHub (Oct 16, 2026):

Independently reproduced on source 709b5cbdc15aa757f89c38ecd12e5a47710747a6 with an actual canonical staged hook and paired native EventEmitter controls:

Engine Embedded Node Cases Behavioral disagreements
Pinned Node 24.18.0 21 0
Official Node runtime 24.21.0 21 9
Actual generic Electron44.7.0 binary, run as Node 24.21.0 21 9

For call-opaque with zero arguments and apply-opaque with one argument, native24.21 executes the callback once, while the hook executes it zero times and retains a successful main-event-invocation. The issue is now confirmed as a runtime-dispatch/evidence bug, not merely a source hypothesis. The pinned old runtime also exposes false invocation metadata for opaque methods that legitimately skip the callback.

The alternate runtime was downloaded into an owned temporary packet and verified against official SHASUMS, Linuxx64xz SHA fd8e59d5a511510f6a298afb548f18c7d2b1be404d8b4a27d94fbe49f56cb2d6; binary SHA 7fde7b8afa198da66257f42ee2001d874c7355631e6d1579a5fb5ef1f246df4c. The project's pinned toolchain was not upgraded.

These are controlled producer tests with a minimal Electron module, including the real embedded Node engine; they do not establish a real GUI application's natural callback loss. Practical app impact and completed-task performance/token delta remain NOT_ENOUGH_INFO. A separate branch fix/electron-native-once-4593-20261016 is testing native-owned once dispatch, exact app metadata/receiver behavior and truthful observation gaps; no fix is claimed merged yet. Initial and failed candidate receipts remain preserved.

<!-- gh-comment-id:6224957363 --> @N0zoM1z0 commented on GitHub (Oct 16, 2026): Independently reproduced on source `709b5cbdc15aa757f89c38ecd12e5a47710747a6` with an actual canonical staged hook and paired native EventEmitter controls: | Engine | Embedded Node | Cases | Behavioral disagreements | |---|---|---:|---:| | Pinned Node |24.18.0|21|0| | Official Node runtime |24.21.0|21|9| | Actual generic Electron44.7.0 binary, run as Node |24.21.0|21|9| For `call-opaque` with zero arguments and `apply-opaque` with one argument, native24.21 executes the callback once, while the hook executes it zero times and retains a successful `main-event-invocation`. The issue is now confirmed as a runtime-dispatch/evidence bug, not merely a source hypothesis. The pinned old runtime also exposes false invocation metadata for opaque methods that legitimately skip the callback. The alternate runtime was downloaded into an owned temporary packet and verified against [official SHASUMS](https://nodejs.org/download/release/v24.21.0/SHASUMS256.txt), Linuxx64xz SHA `fd8e59d5a511510f6a298afb548f18c7d2b1be404d8b4a27d94fbe49f56cb2d6`; binary SHA `7fde7b8afa198da66257f42ee2001d874c7355631e6d1579a5fb5ef1f246df4c`. The project's pinned toolchain was not upgraded. These are controlled producer tests with a minimal Electron module, including the real embedded Node engine; **they do not establish a real GUI application's natural callback loss**. Practical app impact and completed-task performance/token delta remain NOT_ENOUGH_INFO. A separate branch `fix/electron-native-once-4593-20261016` is testing native-owned once dispatch, exact app metadata/receiver behavior and truthful observation gaps; no fix is claimed merged yet. Initial and failed candidate receipts remain preserved.
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#2383
No description provided.