Skip to content

fix(browser): retire pending selection replies with their frame - #35421

Closed
OrcaWin wants to merge 1 commit into
mainfrom
OrcaWin/browser-grab-frame-reply-lifetime
Closed

OrcaWin wants to merge 1 commit into
mainfrom
OrcaWin/browser-grab-frame-reply-lifetime

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​289 $\color{#cf222e}{\Huge{\mathbf{−}}}$​74 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​215
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​55 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​53

LoC: +344/-76

Release browser selection script replies with their document frame when a grab is cancelled, navigated away from, or destroyed. Preserve guest error messages, loaded-document scheduling, selected overlays, successor operations and the existing 120-second timeout. The readiness listener belongs to the existing operation cleanup, so retirement prevents a late script injection.

Validation: 97 focused tests across seven files, node typecheck, nine quality groups and all five unchanged precommit tasks pass. Actual hidden native Electron controls change retained destroyed WebContents wrappers from 1/10 to 0/0 after N1/N10 cancel-and-destroy, destroy, navigation and crash-and-destroy workloads. Healthy selection/context/cancel/successor results are equal, readiness cancellation leaves no late injection, and the unchanged real 120-second timeout passes in both arms. Root independently verified the 69-file seal, 13 native source inputs, exact patch/bundle and current-main controller equality.

This is controller/script evidence on isolated Linux, with no full Orca UI, macOS/Windows, RSS/heap-byte, CPU or latency claim. Required aggregate validation is queued after #35419; no aggregate pass or review takeover is claimed. The earlier package build implicitly ran pnpm install/postinstall/prepare; logs and corrected dependency-link provenance are preserved. No untouched-store or exact final donor-parity claim, and no subsequent install/repair/rollback.

Frozen author: 782e8a6608b283bd471fa23eba012d653eb90127, based on 50182418667d99313fab4ff18efde230b08b79f3. Evidence: /home/neil/.local/state/orca-electron-audit/browser-grab-frame-reply-lifetime-author-evidence/ and browser-grab-frame-reply-lifetime-publication/.

@OrcaWin

OrcaWin commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks. The leftover ipcMainInternal reply listener is real (we confirmed it in Electron 43.8.1's invokeInWebContents), but it's one small listener per grab interrupted by navigation or tab close. The controller already settles on navigation, destroy, timeout and cancel, so users see no hang or stuck overlay. Copying Electron's waitTillCanExecuteJavaScript by hand and switching to mainFrame.executeJavaScript, which rejects differently, costs more to maintain than the leak is worth.

Closing per maintainer triage (low-risk / zero user trade-off / material-gain bar).

@OrcaWin OrcaWin closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant