René's URL Explorer Experiment


Title: fix: honour --reconnection-grace-time when the browser closes by hugodeco · Pull Request #7956 · coder/code-server · GitHub

Open Graph Title: fix: honour --reconnection-grace-time when the browser closes by hugodeco · Pull Request #7956 · coder/code-server

X Title: fix: honour --reconnection-grace-time when the browser closes by hugodeco · Pull Request #7956 · coder/code-server

Description: 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 pagehide persists UI state (storageService.flush(WillSaveStateReason.SHUTDOWN)) instead of unloading. A browser-driven unload no longer tears the workbench down. The veto handler is only passed on the browser path, so that is the discriminator: a beforeunload veto is still honoured, and an explicit in-product shutdown (shutdown(), which passes no veto handler) still unloads normally. lib/vscode/src/vs/server/node/remoteExtensionHostAgentServer.ts The grace time is only shortened when it was left at or below ProtocolConstants.ReconnectionGraceTime. Installations that never set the flag keep Code's stock behaviour; only an operator who deliberately raised it opts into the longer wait. Also updates the unreleased changelog section. Test plan quilt pop -a && quilt push -a — full series applies cleanly with the new patch npm run typecheck-client in lib/vscode — passes npm run lint:ts — passes npm run test:unit — 331/332; the one failure (should unlink a socket before listening on the socket, expecting EACCES) is environmental, from running as root, and exercises src/node/app.ts, which this PR does not touch npm run valid-layers-check fails identically with and without this patch (pre-existing, in network.ts / extensionResourceLoader.ts) Behaviour verified in production on 4.128.0: with --reconnection-grace-time 2592000, sessions survive closing the browser and reconnect on return 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

Open Graph Description: 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 run...

X Description: 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 run...

Opengraph URL: https://github.com/coder/code-server/pull/7956

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:1f7b89b5-db85-b230-86ff-c25715e1723e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD492:12691F:3C3B2E:50B61B:6B0437C4
html-safe-noncecb20a741a27518f6a3af61f705720865a05dfd5fa9ef6e98794d5dff41e41d3d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDkyOjEyNjkxRjozQzNCMkU6NTBCNjFCOjZCMDQzN0M0IiwidmlzaXRvcl9pZCI6IjY4OTIwNjAwMTk0MDAxMjg0NTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac738af76d100596184e0f4d5b23017a02224cce33755b648cde9482dd56b7f9f1
hovercard-subject-tagpull_request:4316753997
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/coder/code-server/pull/7956/files
twitter:imagehttps://avatars.githubusercontent.com/u/2934665?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/2934665?s=400&v=4
og:image:altFixes #7955 Summary --reconnection-grace-time (#7678) cannot currently deliver what it documents, for two independent reasons: Closing the tab bypasses the grace time. BrowserLifecycleService run...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/coder/code-server git https://github.com/coder/code-server.git
octolytics-dimension-user_id95932066
octolytics-dimension-user_logincoder
octolytics-dimension-repository_id172953845
octolytics-dimension-repository_nwocoder/code-server
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id172953845
octolytics-dimension-repository_network_root_nwocoder/code-server
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release06dc448a76fe4751ac1db26524aefa3aa3e889a8
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/coder/code-server/pull/7956/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcode-server%2Fpull%2F7956%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcode-server%2Fpull%2F7956%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=coder%2Fcode-server
Reloadhttps://github.com/coder/code-server/pull/7956/files
Reloadhttps://github.com/coder/code-server/pull/7956/files
Reloadhttps://github.com/coder/code-server/pull/7956/files
coderhttps://github.com/coder
code-serverhttps://github.com/coder/code-server
Codehttps://github.com/coder/code-server
Issues147 (147)https://github.com/coder/code-server/issues
Pull requests15 (15)https://github.com/coder/code-server/pulls
Discussionshttps://github.com/coder/code-server/discussions
Actionshttps://github.com/coder/code-server/actions
Projectshttps://github.com/coder/code-server/projects
Security and quality3 (3)https://github.com/coder/code-server/security
Insightshttps://github.com/coder/code-server/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fcoder%2Fcode-server%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fcoder%2Fcode-server%2Fissues%2Fnew%2Fchoose
hugodecohttps://github.com/hugodeco
coder:mainhttps://github.com/coder/code-server/tree/main
hugodeco:fix/honour-reconnection-grace-timehttps://github.com/hugodeco/code-server/tree/fix/honour-reconnection-grace-time
Conversation 1 https://github.com/coder/code-server/pull/7956
Commits 1 https://github.com/coder/code-server/pull/7956/commits
Checks 0 https://github.com/coder/code-server/pull/7956/checks
Files changed https://github.com/coder/code-server/pull/7956/files
Please reload this pagehttps://github.com/coder/code-server/pull/7956/files
fix: honour --reconnection-grace-time when the browser closes https://github.com/coder/code-server/pull/7956/files#top
Show all changes 1 commit https://github.com/coder/code-server/pull/7956/files
36dac5d fix: honour --reconnection-grace-time when the browser closes hugodeco Aug 19, 2026 https://github.com/coder/code-server/pull/7956/commits/36dac5d782016bb8a6817a5ef847f5d972323f41
Clear filters https://github.com/coder/code-server/pull/7956/files
Please reload this pagehttps://github.com/coder/code-server/pull/7956/files
Please reload this pagehttps://github.com/coder/code-server/pull/7956/files
CHANGELOG.md https://github.com/coder/code-server/pull/7956/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
series https://github.com/coder/code-server/pull/7956/files#diff-d6f19469bd3dd1daec926b99bf179ec128fff3631356f24af05320c1827f1e46
session-preservation.diff https://github.com/coder/code-server/pull/7956/files#diff-ebf269f6c9a41acfad0b013035bb66c76c8be1a38b14058a8b2ff887dc13c6d3
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
CHANGELOG.mdhttps://github.com/coder/code-server/pull/7956/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
View file https://github.com/coder/code-server/blob/36dac5d782016bb8a6817a5ef847f5d972323f41/CHANGELOG.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/7956/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/7956/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
https://github.com/coder/code-server/pull/7956/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
patches/serieshttps://github.com/coder/code-server/pull/7956/files#diff-d6f19469bd3dd1daec926b99bf179ec128fff3631356f24af05320c1827f1e46
View file https://github.com/coder/code-server/blob/36dac5d782016bb8a6817a5ef847f5d972323f41/patches/series
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/7956/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/7956/files#diff-d6f19469bd3dd1daec926b99bf179ec128fff3631356f24af05320c1827f1e46
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
patches/session-preservation.diffhttps://github.com/coder/code-server/pull/7956/files#diff-ebf269f6c9a41acfad0b013035bb66c76c8be1a38b14058a8b2ff887dc13c6d3
View file https://github.com/coder/code-server/blob/36dac5d782016bb8a6817a5ef847f5d972323f41/patches/session-preservation.diff
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/7956/{{ revealButtonHref }}
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.