René's URL Explorer Experiment


Title: Chat diff-status worker re-downloads unchanged PRs instead of using conditional requests · Issue #27627 · coder/coder · GitHub

Open Graph Title: Chat diff-status worker re-downloads unchanged PRs instead of using conditional requests · Issue #27627 · coder/coder

X Title: Chat diff-status worker re-downloads unchanged PRs instead of using conditional requests · Issue #27627 · coder/coder

Description: Summary The chat diff-status worker polls open pull requests on a fixed 10s interval and re-downloads the full JSON body on every tick, even when nothing changed. The GitHub client (coderd/externalauth/gitprovider/github.go) never sends ...

Open Graph Description: Summary The chat diff-status worker polls open pull requests on a fixed 10s interval and re-downloads the full JSON body on every tick, even when nothing changed. The GitHub client (coderd/external...

X Description: Summary The chat diff-status worker polls open pull requests on a fixed 10s interval and re-downloads the full JSON body on every tick, even when nothing changed. The GitHub client (coderd/external...

Opengraph URL: https://github.com/coder/coder/issues/27627

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Chat diff-status worker re-downloads unchanged PRs instead of using conditional requests","articleBody":"## Summary\n\nThe chat diff-status worker polls open pull requests on a fixed 10s interval and re-downloads the full JSON body on every tick, even when nothing changed. The GitHub client (`coderd/externalauth/gitprovider/github.go`) never sends `If-None-Match` / ETag, so GitHub always returns a full `200 OK` instead of a cheap `304 Not Modified`.\n\n## Why it matters\n\n`304` responses don't count against GitHub's **primary rate limit**; full `200`s do. Every unchanged poll needlessly burns a user's/installation's API quota — multiplied by the number of tracked PRs and the 10s cadence. On busy instances this worker can quietly exhaust the quota that the same token needs for interactive Git and API operations, so users hit rate-limit errors and stalls elsewhere in Coder. Adopting conditional requests fixes that with no behavior change — unchanged PRs revalidate for free, and only real changes transfer a body.\n\n## Where\n\n- `coderd/x/gitsync/worker.go`: `defaultInterval = 10 * time.Second`, `defaultBatchSize = 50`.\n- Per refresh (all full `200`s today): `ResolveBranchPullRequest` → `GET /repos/{owner}/{repo}/pulls?...`; `FetchPullRequestStatus` → `GET /repos/{owner}/{repo}/pulls/{n}` and `.../pulls/{n}/reviews?per_page=100`.\n- `githubProvider.decodeJSON` sets `Accept`, `X-GitHub-Api-Version`, and a bearer token but no `If-None-Match`, and keeps no ETag cache. The worker is a long-lived singleton, so an in-process cache persists across ticks.\n\n## Proposed fix\n\nAdd a small, concurrency-safe, bounded ETag+body cache and wire it into `decodeJSON`: key on request URL + a hash of the token (never serve one token's response under another; don't retain raw tokens); send `If-None-Match` when an ETag is cached; on `304` decode the cached body; on `200` cache `{etag, body}` under a size cap. Bound by entry count and per-body size. Leave the raw-diff path (`fetchDiff`) out of scope to avoid caching large bodies.","author":{"url":"https://github.com/joshfree","@type":"Person","name":"joshfree"},"datePublished":"2026-07-29T00:45:44Z","url":"https://github.com/coder/coder/issues/27627"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ad8a76bd-c4ec-4e59-9a0d-4aa7ff966111
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD1A0:1739C:3860F6:4B3B7C:6B04B9EB
html-safe-nonced85825a473b0d0a4a72fb1db5b5129f75e82a09e30df423625b48fbb2ad039f5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMUEwOjE3MzlDOjM4NjBGNjo0QjNCN0M6NkIwNEI5RUIiLCJ2aXNpdG9yX2lkIjoiMzQyMzM2NDQ2NzQ0OTQ0NDg0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac40f0e965453d79062407a98d90b5b4a22c87e418d52aa6232200efe763801d0b
hovercard-subject-tagissue:5004241844
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/27627/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4bed2dbdfbf40ed298a8af6cc88c34774fcfc1ed410d907c870766f23a83cb20/coder/coder/issues/27627
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4bed2dbdfbf40ed298a8af6cc88c34774fcfc1ed410d907c870766f23a83cb20/coder/coder/issues/27627
og:image:altSummary The chat diff-status worker polls open pull requests on a fixed 10s interval and re-downloads the full JSON body on every tick, even when nothing changed. The GitHub client (coderd/external...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejoshfree
hostnamegithub.com
expected-hostnamegithub.com
None378bd702ac792b3550e484ad39d9a898fcd25bb52ba6962b0c9cc457c1ea71c7
turbo-cache-controlno-preview
go-importgithub.com/coder/coder git https://github.com/coder/coder.git
octolytics-dimension-user_id95932066
octolytics-dimension-user_logincoder
octolytics-dimension-repository_id440752086
octolytics-dimension-repository_nwocoder/coder
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id440752086
octolytics-dimension-repository_network_root_nwocoder/coder
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb032e77f1ea437ede6c115446a0a467709b468e7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/coder/coder/issues/27627#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fissues%2F27627
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%2Fcoder%2Fissues%2F27627
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=coder%2Fcoder
Reloadhttps://github.com/coder/coder/issues/27627
Reloadhttps://github.com/coder/coder/issues/27627
Reloadhttps://github.com/coder/coder/issues/27627
coderhttps://github.com/coder
coderhttps://github.com/coder/coder
Codehttps://github.com/coder/coder
Issues322 (322)https://github.com/coder/coder/issues
Pull requests475 (475)https://github.com/coder/coder/pulls
Discussionshttps://github.com/coder/coder/discussions
Actionshttps://github.com/coder/coder/actions
Projectshttps://github.com/coder/coder/projects
Security and quality49 (49)https://github.com/coder/coder/security
Insightshttps://github.com/coder/coder/insights
https://github.com/coder/coder
New issuehttps://github.com/login?return_to=https://github.com/coder/coder/issues/27627
New issuehttps://github.com/login?return_to=https://github.com/coder/coder/issues/27627
#27628https://github.com/coder/coder/pull/27628
Chat diff-status worker re-downloads unchanged PRs instead of using conditional requestshttps://github.com/coder/coder/issues/27627#top
#27628https://github.com/coder/coder/pull/27628
https://github.com/joshfree
joshfreehttps://github.com/joshfree
on Jul 29, 2026https://github.com/coder/coder/issues/27627#issue-5004241844
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Jul 29, 2026https://github.com/coder/coder/issues/27627#issuecomment-5111424811
Linear Codehttps://linear.app
ENG-3108https://linear.app/codercom/issue/ENG-3108
johnstcnhttps://github.com/johnstcn
completedhttps://github.com/coder/coder/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#27628https://github.com/coder/coder/pull/27628
on Jul 30, 2026https://github.com/coder/coder/issues/27627#event-28733129090
johnstcnhttps://github.com/johnstcn
on Jul 30, 2026https://github.com/coder/coder/issues/27627#event-28733129092
feat(coderd/externalauth/gitprovider): use conditional requests for G…https://github.com/coder/coder/commit/2acfe7e82994e5c0d999f2f00313261e2fa428f3
https://docs.github.com/articles/closing-issues-via-commit-messages
2acfe7ehttps://github.com/coder/coder/commit/2acfe7e82994e5c0d999f2f00313261e2fa428f3
johnstcnhttps://github.com/johnstcn
on Aug 18, 2026https://github.com/coder/coder/issues/27627#event-29605409135
fix: follow-up fixes for conditional VCS requests (#27711)https://github.com/coder/coder/commit/6079c514ee991a4d89bf770ab91ff81b90a2127c
#27711https://github.com/coder/coder/pull/27711
6079c51https://github.com/coder/coder/commit/6079c514ee991a4d89bf770ab91ff81b90a2127c
Sign up for freehttps://github.com/signup?return_to=https://github.com/coder/coder/issues/27627
Sign in to commenthttps://github.com/login?return_to=https://github.com/coder/coder/issues/27627
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-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.