Skip to content

feat(browser): retain client page renderer guests - #14596

Closed
Jinwoo-H wants to merge 1 commit into
sta-4150-browser-client-page-mount-bridgefrom
sta-4150-browser-client-page-renderer-registry
Closed

Jinwoo-H wants to merge 1 commit into
sta-4150-browser-client-page-mount-bridgefrom
sta-4150-browser-client-page-renderer-registry

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​876 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​876
Prod 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​929 $\color{#cf222e}{\Huge{\mathbf{−}}}$​48 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​881

ELI5

Main can now ask the current desktop renderer to park one exact blank Electron webview and later remove it. The webview stays hidden and inert until a later stage separately registers and authorizes navigation.

What Changed

  • Added a top-frame-only preload request queue with bounded capacity, timeouts, subscriber replacement fencing, authenticated outcomes, and contained transport failure.
  • Added a document-owned retained webview registry keyed by partition, page ID, and host generation, with global/per-partition budgets and exact attach/retire/destruction handling.
  • Added deterministic and real Electron lifecycle coverage, paired-web inertness, and a reliability-gate ledger.

Why

The main-process bridge in #14578 had no renderer consumer. This narrow layer supplies that consumer without advertising client placement, navigating a guest, changing the remote wire, or affecting old/server-hosted clients.

Linked Issue

STA-4150

Visual Proof

N/A — this stage is production-inert and has no visible UI or interaction change.

Testing

  • 12 focused files / 199 tests, including an isolated Electron 43.1.0 main/preload/renderer/webview lifecycle.
  • Broad browser/window/preload/renderer regression: 137 files / 1,533 tests with one intentional skip before final focused hardening.
  • Full Node/CLI/web typecheck and lint/audits; 85 reliability gates; changed-code quality; max-lines; formatting; diff checks.
  • Electron production build and paired-web projection.
  • Local platform: macOS. Linux/Windows packaging and the full CI matrix are running.

Review

Fresh correctness/lifecycle, security, and resource reviews were run. The implementation remains fail-closed: missing destruction can retain bounded capacity, transient guest-ID unreadability can conservatively fence a guest, and live cross-platform/traffic containment remains required before activation.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Visual proof is N/A because behavior is not activated
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, browserless, paired-web, and mixed-version impact considered
  • Relevant local tests, lint, typecheck, and builds pass; full CI is running

@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-renderer-registry branch from b49d3bd to 4b6674f Compare August 14, 2026 21:03
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-renderer-registry branch from 4b6674f to d79f937 Compare August 14, 2026 23:17
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-renderer-registry branch from d79f937 to 9d45154 Compare August 15, 2026 00:44
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-renderer-registry branch 2 times, most recently from 190ae41 to a475b30 Compare August 15, 2026 02:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-renderer-registry branch 3 times, most recently from e7b05e3 to 9a92b3b Compare August 15, 2026 10:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-renderer-registry branch 2 times, most recently from bbc17c3 to cad7b90 Compare August 15, 2026 12:30
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-client-page-renderer-registry branch from cad7b90 to 197c63c Compare August 16, 2026 09:09
@OrcaWin

OrcaWin commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Closing this retained-renderer stage because the implementation and meaningful lifecycle regressions are present on current origin/main (1a723194c32).

The top-frame preload queue still has 512 pending requests, bounded timeout, exact request/outcome binding, subscriber replacement fencing and contained reply transport failure. It now also rejects work settled before its microtask and supports rekey. The document-owned renderer registry still keys partition/page/generation, bounds 256 pages and 64 per partition, mounts about:blank, and holds observed/attached generations until exact destruction. Its later visible-attachment support changes the intermediate hidden-root representation while preserving hidden/inert parked hosts and explicit disconnect cleanup.

The preload surface/bootstrap and HMR disposal remain wired after extraction, and preload still bundles zod. The installation regression now covers mount/rekey/retire in one subscriber. The static configuration assertion was removed, but its production bundling setting remains; the real Electron mount/destruction regression also remains checked in. I did not rerun Electron here.

Current retained registry + preload suites passed in the seven-file reconciliation run (114 tests total); the installation and build-output suites additionally passed 14 tests. No claim is made here that all later activation/platform proofs are complete.

@OrcaWin OrcaWin closed this Oct 26, 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.

2 participants