Skip to content

fix(browser): fence navigation on terminal host loss - #14754

Closed
Jinwoo-H wants to merge 1 commit into
sta-4150-browser-lease-fence-placement-retirementfrom
sta-4150-browser-navigation-grant-lease-fencing
Closed

Jinwoo-H wants to merge 1 commit into
sta-4150-browser-lease-fence-placement-retirementfrom
sta-4150-browser-navigation-grant-lease-fencing

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​149 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​141
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​330 $\color{#cf222e}{\Huge{\mathbf{−}}}$​86 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​244

Summary

  • synchronously suspend client-hosted browser routes and revoke exact retained WebContents navigation grants when terminal browser-host authority is lost
  • preserve pages, grants, and stable route listeners during negotiated recoverable reconnect
  • block late in-flight page creation after every asynchronous admission boundary
  • keep revocation separate from guest destruction; cleanup still runs and reports if revocation itself throws

Causal evidence

On the #14753 tip, the new composition oracle was red (1 failed / 10 passed): terminal host loss started asynchronous close without first suspending routes or revoking navigation. The candidate makes those fences observable before close-host, while exact opaque guest claims prevent a stale generation or reused WebContents ID from revoking a replacement.

Validation

  • focused: 3 files / 62 tests
  • WebContents and isolated Electron lifecycle: 12 files / 132 tests
  • paired-runtime surface: 16 files / 167 tests
  • mixed-version terminal wire: 5 / 5
  • Node, CLI, and web typecheck
  • changed-code quality, 87 reliability gates, max-lines ratchet, localization, formatting, and diff checks
  • full lint reaches only the pre-existing config/scripts/pr-test-loc-summary.test.mjs:88 type-aware warning on current main; all preceding and later lint subchecks pass

Compatibility and scope

No exchanged field, opcode, capability, payload, publication, placement default, SSH/WSL adapter, workspace shape, UI, dependency, or server/offscreen placement behavior changes. Old clients and server-hosted browser behavior remain unchanged. The client-hosted path is still production-inert; this stage does not advertise capabilities or activate placement.

Linear: STA-4150

Stacked on #14753. Draft only; do not merge or mark ready.

@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-navigation-grant-lease-fencing branch from d3e599b to 03d1b02 Compare August 15, 2026 09:44
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-lease-fence-placement-retirement branch from f66edf2 to 6844a52 Compare August 15, 2026 10:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-navigation-grant-lease-fencing branch from 03d1b02 to 3452293 Compare August 15, 2026 10:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-lease-fence-placement-retirement branch from 6844a52 to fb6389c Compare August 15, 2026 11:34
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-navigation-grant-lease-fencing branch 2 times, most recently from 9fe7182 to 993b99b Compare August 15, 2026 12:30
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-lease-fence-placement-retirement branch from fb6389c to 5828033 Compare August 15, 2026 12:30
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-lease-fence-placement-retirement branch from 5828033 to c161753 Compare August 16, 2026 09:09
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-navigation-grant-lease-fencing branch from 993b99b to 408d8c4 Compare August 16, 2026 09:09
@OrcaWin

OrcaWin commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Closing because this browser authority/admission stage is already implemented on current main (ad2156c3584). I compared the complete production patch, body/discussion, and regression intent with the current extracted modules.

Terminal composition close still synchronously fences all route sets and exact guest navigation before awaiting host cleanup, via fenceBrowserClientHostComposition. Exact opaque lifecycle claims prevent a stale page/WebContents incarnation from revoking a replacement. The executor navigation fence remains set even when revocation throws; cleanup still attempts all resources and aggregates errors. Creation checks availability after async route/session/mount admission. Six introduced regression names remain; the former in-flight-create fencing oracle is now covered by the broader close/authority-transition race cases, which assert route release and no navigation grant. Recoverable reconnect still suspends routes while retaining page lifetime. The historical progress-document changes describe that staged implementation; they do not leave an independent production change to recover.

Validation: current composition, executor-fencing and command-admission suites passed 37 tests; browser-host runtime admission passed 4 tests. Tests ran with ORCA_BACKGROUND_LAUNCH=1 and two workers. This is supersession of this stage, without asserting every broader STA-4150 activation criterion.

@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