Skip to content

fix(electron): unwrap asserted inline window options - #4281

Closed
geekwolf wants to merge 1 commit into
morluto:mainfrom
geekwolf:fix/electron-asserted-window-options
Closed

geekwolf wants to merge 1 commit into
morluto:mainfrom
geekwolf:fix/electron-asserted-window-options

Conversation

@geekwolf

@geekwolf geekwolf commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Upstream integration update — 2026-10-16

Main already includes the fix in b67baede2ed679bdb22af5d9c62a549c30cff9b0, referencing #4250 and this PR, with Geekwolf credited as co-author. It uses the shared expression owner and includes CLI and stdio MCP regression coverage. No duplicate implementation or replacement code push is proposed.

Verified upstream main 808339f0b1cf3837445f392b5d5f1f362d64a27d on Windows x64 with Node 24.18.0 / npm 11.16.0: all 23 options tests and four compiled CLI/stdio MCP preload-override workflows passed, including transparent wrappers and unresolved later overrides. These are static-analysis fixtures; no real Electron process or preload code was executed. This PR remains open/draft; code integration is not a GitHub merge of this PR. The original proposal and its historical verification follow.


Summary

Fixes #4250. Inline BrowserWindow options or webPreferences wrapped in as const now retain their explicit preferences and preload associations, just like unwrapped object literals.

Change and scope

The BrowserWindow syntax owner uses the existing type-erased expression normalizer before classifying each object. Object property lookup still owns overwrite order: unknown later spreads and computed keys do not become resolved preload paths. No new evaluator, alias expansion, API/schema change, Electron execution or provider authority. Maintainer scope decision: not applicable to this existing static-analysis correction.

Evidence and validation

  • Reproduced on main 93c620c3: two new syntax cases failed; the compiled CLI reported only one preload entry instead of three for six windows.
  • After the fix, four focused files passed all 33 tests (options, computed preferences, Electron binding identity and compiled CLI).
  • The CLI checks actual source ranges for the three linked windows, explicit preferences, existing absolute preload paths and zero parse failures. Dynamic-object, unknown-spread and computed-key controls remain unlinked. Fixture source is inert; no Electron process or preload code is executed.
  • check:fast, verify:test-discovery (1,388 files), staged formatting/lint and git diff --check passed. Node 24.18.0 / npm 11.16.0 invoked on Windows x64. No real Electron or MCP verification claim.
  • The full check on the same baseline is blocked by unchanged src/adb/AdbProvider.ts formatting. Full current-head CI is required; unrelated formatting is not included here.

Author readiness

Human owner: @geekwolf

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

morluto added a commit that referenced this pull request Oct 16, 2026
Use the shared expression owner for BrowserWindow options and webPreferences. Retain overwrite and spread uncertainty through CLI and MCP evidence.

Refs: #4250, #4281

Co-authored-by: Geekwolf <[email protected]>
@geekwolf geekwolf closed this Oct 16, 2026
@morluto morluto added bug Something isn't working provider: electron Analysis provider / engine: electron labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working provider: electron Analysis provider / engine: electron

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Const-asserted inline BrowserWindow objects lose preferences and preload links

2 participants