| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
--reconnection-grace-time lets an operator say how long a disconnected session should be kept, but two behaviours inherited from Code stop it from delivering that. Closing the tab runs the browser workbench's shutdown, which disposes the remote connection gracefully. The server reads a graceful dispose as "the client is finished" and cleans up at once, so the grace time is never consulted -- the session dies with the tab however the flag is set. Separately, any new connection shortens every disconnected session to ProtocolConstants.ReconnectionShortGraceTime (5 minutes), so opening a second tab cuts a deliberately long grace time back down. Add patches/session-preservation.diff, which makes the configured grace time authoritative: pagehide persists UI state instead of unloading, a browser-driven unload no longer tears the workbench down (beforeunload vetoes are still honoured, and an explicit in-product shutdown still unloads), and the grace time is only shortened when it was left at or below the default, so installations that never set the flag keep Code's stock behaviour. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Thank you for the PR! This feels like something we should commit directly to VS Code rather than try to maintain as a patch here. Could we try submitting it upstream? |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #7955
Summary
--reconnection-grace-time (#7678) cannot currently deliver what it documents, for two independent reasons:
Closing the tab bypasses the grace time. BrowserLifecycleService runs the workbench shutdown on pagehide/beforeunload, disposing the remote connection gracefully. ManagementConnection treats a graceful dispose as a finished client and calls _cleanResources() immediately — the grace time is never consulted, so the session dies with the tab however the flag is set.
A second connection cuts it to 5 minutes. Every new connection calls shortenReconnectionGraceTimeIfNecessary() on all disconnected connections, scheduling ProtocolConstants.ReconnectionShortGraceTime. Opening a second tab is enough to shorten a deliberately long grace time.
This adds patches/session-preservation.diff, which makes the configured grace time authoritative.
Changes
lib/vscode/src/vs/workbench/services/lifecycle/browser/lifecycleService.ts
lib/vscode/src/vs/server/node/remoteExtensionHostAgentServer.ts
Also updates the unreleased changelog section.
Test plan
I was not able to run a full product build on the machine I had available (disk), so a CI build is the remaining check.
🤖 Generated with Claude Code