[PR #4281] [CLOSED] fix(electron): unwrap asserted inline window options #6155

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4281
Author: @geekwolf
Created: 10/15/2026
Status: ❌ Closed

Base: main ← Head: fix/electron-asserted-window-options


📝 Commits (1)

  • 5f84217 fix(electron): unwrap asserted inline window options

📊 Changes

3 files changed (+128 additions, -7 deletions)

View changed files

📝 src/domain/javascript/electronStaticAnalysisBrowser.ts (+15 -7)
📝 src/domain/javascript/electronStaticAnalysisOptions.test.ts (+27 -0)
➕ tests/acceptance/applications/assertedWindowOptions.test.ts (+86 -0)

📄 Description

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.

🔄 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/4281 **Author:** [@geekwolf](https://github.com/geekwolf) **Created:** 10/15/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/electron-asserted-window-options` --- ### 📝 Commits (1) - [`5f84217`](https://github.com/morluto/rea/commit/5f842178b923251fa09991ccdf9c8ef27bf46844) fix(electron): unwrap asserted inline window options ### 📊 Changes **3 files changed** (+128 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascript/electronStaticAnalysisBrowser.ts` (+15 -7) 📝 `src/domain/javascript/electronStaticAnalysisOptions.test.ts` (+27 -0) ➕ `tests/acceptance/applications/assertedWindowOptions.test.ts` (+86 -0) </details> ### 📄 Description ## Upstream integration update — 2026-10-16 Main already includes the fix in [b67baede2ed679bdb22af5d9c62a549c30cff9b0](https://github.com/morluto/rea/commit/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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:12: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#6155
No description provided.