René's URL Explorer Experiment


Title: Keep the heartbeat going when its timer fires early by b84330808 · Pull Request #8141 · coder/code-server · GitHub

Open Graph Title: Keep the heartbeat going when its timer fires early by b84330808 · Pull Request #8141 · coder/code-server

X Title: Keep the heartbeat going when its timer fires early by b84330808 · Pull Request #8141 · coder/code-server

Description: Fixes #5969 Every minute the heartbeat timer checks for open connections and calls beat() again if there are any. beat() returns early while alive() is true, and alive() compares Date.now() with the last beat. Timers don't run on the Date.now() clock, so the timer can fire when Date.now() still shows a millisecond or more less than the full minute (more if the system clock is being slewed or stepped back). When that happens beat() returns without writing the file or scheduling the next check, and nothing restarts it until the next plain HTTP request. Terminal and editor traffic goes over the web socket that's already open, so it doesn't count. I think this is what #5969 runs into: the file stops updating after a while, and only opening a new file or reloading the tab starts it again. It also means the state never goes to expired, so --idle-timeout-seconds doesn't shut down after the last client leaves. The timer now writes the heartbeat and schedules the next check directly instead of going through alive(). Requests still go through beat(), so they still write at most once per interval. Added a test that moves the fake clock back 1 ms before the timer fires. It fails without the change (isActive is called once instead of twice) and passes with it. I also ran the real Heart class with real timers and the interval set to 20 ms, on Windows 11 with Node 24.15: 4 runs before and 4 after the change, alternating, up to 1500 checks each. Before the change the heartbeat stopped in 2 of 4 runs (after 176 and 464 checks), each time right after the timer fired early. After the change it never stopped, including one run where the timer fired early.

Open Graph Description: Fixes #5969 Every minute the heartbeat timer checks for open connections and calls beat() again if there are any. beat() returns early while alive() is true, and alive() compares Date.now() with th...

X Description: Fixes #5969 Every minute the heartbeat timer checks for open connections and calls beat() again if there are any. beat() returns early while alive() is true, and alive() compares Date.now() with th...

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

X: @github

direct link

Domain: github.com

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:633aa340-328a-ae78-0701-b65e149c52cd
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8AA8:96DDF:2C4BC5C:38306C5:6B01AA3E
html-safe-nonce7eaf26f9c32cb906e3d4ca9b15dffc0f7e7ea68604a7d919a316409695d2f828
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QUE4Ojk2RERGOjJDNEJDNUM6MzgzMDZDNTo2QjAxQUEzRSIsInZpc2l0b3JfaWQiOiIxMjQ2OTMzMDc5MTc2NjIwNjA2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac721025289c4d2991dbf56ae71cd30d76f8348c65ab79670b721188941e3824e4
hovercard-subject-tagpull_request:5377616166
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/8141/files
twitter:imagehttps://avatars.githubusercontent.com/u/6395743?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/6395743?s=400&v=4
og:image:altFixes #5969 Every minute the heartbeat timer checks for open connections and calls beat() again if there are any. beat() returns early while alive() is true, and alive() compares Date.now() with th...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/coder/code-server/pull/8141/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcode-server%2Fpull%2F8141%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%2F8141%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/8141/files
Reloadhttps://github.com/coder/code-server/pull/8141/files
Reloadhttps://github.com/coder/code-server/pull/8141/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 requests17 (17)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
b84330808https://github.com/b84330808
coder:mainhttps://github.com/coder/code-server/tree/main
b84330808:fix-heartbeat-early-timerhttps://github.com/b84330808/code-server/tree/fix-heartbeat-early-timer
Conversation 1 https://github.com/coder/code-server/pull/8141
Commits 1 https://github.com/coder/code-server/pull/8141/commits
Checks 10 https://github.com/coder/code-server/pull/8141/checks
Files changed https://github.com/coder/code-server/pull/8141/files
Please reload this pagehttps://github.com/coder/code-server/pull/8141/files
Keep the heartbeat going when its timer fires early https://github.com/coder/code-server/pull/8141/files#top
Show all changes 1 commit https://github.com/coder/code-server/pull/8141/files
2d90665 Keep the heartbeat going when its timer fires early b84330808 Nov 17, 2026 https://github.com/coder/code-server/pull/8141/commits/2d906652c7b679a8322b64f97543462d3cb81dd5
Clear filters https://github.com/coder/code-server/pull/8141/files
Please reload this pagehttps://github.com/coder/code-server/pull/8141/files
Please reload this pagehttps://github.com/coder/code-server/pull/8141/files
heart.ts https://github.com/coder/code-server/pull/8141/files#diff-2989a333cfc73c8fd9cfb8fc9617768e7a421fd56871015e032441446db31dbc
heart.test.ts https://github.com/coder/code-server/pull/8141/files#diff-209330cadcf86c6dda745c2cfcb29c1c7c5d9d80fbf4ef38b2b1356d81155cde
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
src/node/heart.tshttps://github.com/coder/code-server/pull/8141/files#diff-2989a333cfc73c8fd9cfb8fc9617768e7a421fd56871015e032441446db31dbc
View file https://github.com/coder/code-server/blob/2d906652c7b679a8322b64f97543462d3cb81dd5/src/node/heart.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/8141/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/8141/files#diff-2989a333cfc73c8fd9cfb8fc9617768e7a421fd56871015e032441446db31dbc
https://github.com/coder/code-server/pull/8141/files#diff-2989a333cfc73c8fd9cfb8fc9617768e7a421fd56871015e032441446db31dbc
https://github.com/coder/code-server/pull/8141/files#diff-2989a333cfc73c8fd9cfb8fc9617768e7a421fd56871015e032441446db31dbc
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
test/unit/node/heart.test.tshttps://github.com/coder/code-server/pull/8141/files#diff-209330cadcf86c6dda745c2cfcb29c1c7c5d9d80fbf4ef38b2b1356d81155cde
View file https://github.com/coder/code-server/blob/2d906652c7b679a8322b64f97543462d3cb81dd5/test/unit/node/heart.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/8141/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/8141/files#diff-209330cadcf86c6dda745c2cfcb29c1c7c5d9d80fbf4ef38b2b1356d81155cde
https://github.com/coder/code-server/pull/8141/files#diff-209330cadcf86c6dda745c2cfcb29c1c7c5d9d80fbf4ef38b2b1356d81155cde
Please reload this pagehttps://github.com/coder/code-server/pull/8141/files
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

Viewport: width=device-width


URLs of crawlers that visited me.