Skip to content

fix(window): retire terminal close replies on document replacement - #35442

Closed
OrcaWin wants to merge 1 commit into
mainfrom
OrcaWin/terminal-tab-close-document-retirement
Closed

OrcaWin wants to merge 1 commit into
mainfrom
OrcaWin/terminal-tab-close-document-retirement

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​61 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​61
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4

LoC: +66/-1

Reject obsolete terminal-close acknowledgements when the main renderer commits a normal document replacement. Reuse the existing shared lifecycle cleanup to release deadlines and reply callbacks, preserving request/sender validation, durable acknowledgements, the 20-second live deadline and other windows. This closes the gap between existing crash/close cleanup and a renderer reload.

Validation: seven focused tests pass; three new N1/10/100 cases fail on the old code. Actual bundled production relay/fanout with controlled Electron/timer boundaries changes N retained timers and pending requests to zero after normal committed navigation. Noncommitting, same-document and subframe events preserve requests; a sibling window still acknowledges. Strict focused TypeScript, all five unchanged normal precommit tasks, exact source/bundle and peer review pass. Six relevant production files equal current main 3f56b8f.

This is deterministic ownership evidence, with no native app, full Orca UI, wall-clock latency, CPU or heap/RSS claim. Electron's native source/docs confirm the event contract. Internal error-page commits remain a separate ungraded gap. No install/repair or test timeout/selection change. Required aggregate validation is queued after #35432; no pass or Claude takeover claimed.

Frozen head 47430a9455c2fc522707a5aa042541ee7e4ee93c, base 50182418667d99313fab4ff18efde230b08b79f3. Evidence: /home/neil/.local/state/orca-electron-audit/terminal-tab-close-document-retirement/report.md.

@OrcaWin

OrcaWin commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks. This only makes a close request that is already doomed by a main-frame reload fail right away instead of after the 20s timeout. The callers rethrow either way, so users get the same outcome. The it.each(1/10/100) test is the parametrized-count anti-pattern. That isn't enough gain for the added code, so closing.

Closing per maintainer triage (low-risk / zero user trade-off / material-gain bar).

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

1 participant