Skip to content

fix(main): forward desktop smoke mode to the sandboxed renderer - #249

Merged
johnny4young merged 3 commits into
mainfrom
fix/packaged-smoke-renderer-flag
Oct 14, 2026
Merged

johnny4young merged 3 commits into
mainfrom
fix/packaged-smoke-renderer-flag

Conversation

@johnny4young

@johnny4young johnny4young commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

The v1.6.0 Release run failed in Build macOS → Packaged desktop smoke: the packaged app launched, but the smoke never wrote even its bootstrap artifact and timed out after 6 minutes.

Root cause: since Oct 1 the renderer starts the smoke harness only when window.lingua.desktopSmoke.enabled is true. The preload computes that from its own process.env / process.argv, and a packaged sandboxed renderer sees neither the launcher environment nor main's argv. Probed over CDP on a locally packaged build: bridge: true, enabled: false while main had both the env var and the flag. The dev-server smoke was unaffected, and the packaged smoke does not run in PR CI, so this surfaced only at release time.

Fix: main, which reliably sees smoke mode, forwards --lingua-desktop-smoke to the renderer via webPreferences.additionalArguments only when it is itself in smoke mode. Ordinary windows get no extra argument, so the session-recovery behavior the Oct 1 change protected is unchanged.

Validation

  • pnpm run package:desktop + pnpm run smoke:desktop:packaged locally: before, timed out with no summary; after, Cases: 3, failures: 0.
  • pnpm run smoke:desktop:offline (dev build): 11 cases, 0 failures.
  • New unit test for the forwarded arguments; tests/ipc/desktopSmoke.test.ts, tsc --noEmit, lint green.

Follow-up

Run the packaged smoke in PR CI (at least on macOS) so a renderer-gate regression cannot reach the release job again.

Review follow-up (1782cf1)

  • The smoke flag now lives in src/shared/desktopSmoke.ts and is imported by both main and the preload, so the forwarded argument and the preload check cannot drift apart.
  • A contract test asserts that the main window passes additionalArguments and that the preload reads the shared flag. Removing either wiring, or reintroducing the literal, turns the unit test red (mutation-checked).
  • Local gates: full vitest suite (824 files pass), tsc, typecheck:tests, lint, and package:desktop + smoke:desktop:packaged (Cases: 3, failures: 0).
  • Hosted CI run 38499403394: all green.

- The renderer starts the smoke harness only when its preload reports smoke mode, but a packaged sandboxed renderer sees neither the launcher environment nor main's argv, so the release smoke never started and timed out.
- Main now passes the smoke flag to the renderer through additionalArguments whenever it is itself in smoke mode; ordinary windows get no extra argument.
- Verified with a locally packaged app: the packaged smoke now completes all cases instead of hanging.

Changelog: none
- Only desktopSmokeRendererArguments needs to leave the module; knip flagged the extra export.

Changelog: none
- Share the smoke flag between main and the preload so the forwarded argument and the preload check cannot drift apart.
- Assert that the main window passes the forwarded arguments and that the preload reads the shared flag, so dropping the wiring fails the unit suite instead of the release smoke.

Changelog: none
@johnny4young
johnny4young merged commit e846e64 into main Oct 14, 2026
13 checks passed
@johnny4young
johnny4young deleted the fix/packaged-smoke-renderer-flag branch October 14, 2026 10:59
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