Skip to content

Release native extension-page replies when their operation retires - #35453

Closed
OrcaWin wants to merge 1 commit into
mainfrom
OrcaWin/extension-native-page-reply-retirement
Closed

OrcaWin wants to merge 1 commit into
mainfrom
OrcaWin/extension-native-page-reply-retirement

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​245 $\color{#cf222e}{\Huge{\mathbf{−}}}$​66 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​179
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​51 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​50

LoC: +296/-67

Release native extension-page reply ownership when scripting operations are cancelled or time out. A dedicated sandboxed preload uses the same Electron renderer execution API and returns its result through a scoped WebContents listener, which is removed on every outcome. Preserve script values, native errors, the existing deadline, AbortSignal and hidden-window cleanup.

Validation: 12 focused tests, focused new-code TypeScript and all five unchanged normal precommit tasks pass. Final-head hidden Linux Electron comparisons preserve undefined/sparse values, structured-clone types, statement completion and rejection semantics. Real scripting register/list/duplicate/unregister, storage clear, restore errors, a controlled final-list failure and an entered unresolved-script deadline pass. At a controlled public dispatch/unload ordering, baseline retained wrappers at N1/N10 were 1/8 after five seconds; final was 0/0. All 48 final windows retire with zero scoped reply listeners; native windows end at zero. Root verified 61 sealed artifacts, 104 production source hashes, exact patch and bundle. Five relevant base sources still equal main 9dd4dc5.

Standalone CJS preload entry builds through installed Vite; a full packaged-app build is untested. The widened narrow persistence typecheck reports the same two diagnostics as the pinned baseline; full aggregate validation is queued after #35446. No aggregate pass or Claude takeover claimed. No full Orca UI, natural failure-rate, macOS/Windows, CPU, latency or heap-byte claim. Existing installed dependencies reused without installation or repair. Transport remains local Electron ownership and changes no remote schema or workspace assumptions.

Frozen head d69f5d1d246a5cb282e6cf57a6ffb0d0513521e8, base e5b45ac90f9f95b63f23cc5217e3d32b362cf1ea. Evidence: /home/neil/.local/state/orca-electron-audit/extension-native-page-reply-retirement-implementation/IMPLEMENTATION.md.

@OrcaWin

OrcaWin commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for tracking this down. The leftover Electron invokeInWebContents reply listener is real, but it is only a few hundred bytes. It only appears on the rare timeout/abort paths, and the hidden webContents is destroyed right after. Swapping executeJavaScript for a new sandboxed preload build entry with custom IPC adds packaging and preload-resolution risk: the packaged build is untested, and a missing preload now fails every native-page operation outright. It also adds a lot of test churn. That cost outweighs a negligible leak.

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