fix: resolve 6 critical/important silent bugs#26392
Open
Chukwuebuka-2003 wants to merge 3 commits into
Open
Conversation
- Restore auth middleware on DERP map WebSocket endpoint - Add missing return after fallback ServeHTTP in cachecompress - Drain HTTP response bodies before closing to prevent conn pool starvation - Stabilize onError callback to stop VNC reconnect loop on every render - Fix URL parameter desync in notifications page - Replace mutateAsync with mutate to prevent unhandled rejections
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
cdrci2
added a commit
to coder/cla
that referenced
this pull request
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DERP map auth middleware: Uncommented
r.Use(apiKeyMiddleware)on/api/v2/derp-maproute (coderd/coderd.go:1428). The WebSocket endpoint was streaming internal relay topology (tailcfg.DERPMap) to unauthenticated clients — the swagger docs claimed@Security CoderSessionTokenbut the middleware was commented out.Cachecompress fallthrough: Added missing
returnafterhttp.FileServer(c.orig).ServeHTTP(w, r)fallback inserveRef(coderd/cachecompress/compress.go:228). Whenos.Openfailed, execution continued past the committed response to write headers on an already-committed response andio.Copyfrom a nil*os.File.HTTP body drain before close: Replaced bare
res.Body.Close()withdefer res.Body.Close()+_, _ = io.Copy(io.Discard, res.Body)inPingPeerReplica(enterprise/replicasync/replicasync.go:388-389) and app healthchecks (agent/apphealth.go:100-101). Undrained bodies prevent Go's HTTP transport from reusing connections, causing connection pool starvation under load.VNC reconnect loop on every render: Wrapped the inline
onErrorcallback inuseCallbackwith empty deps inuseDesktopConnection.ts:124-128. The inline arrow created a new reference every render →useClipboard'scopyToClipboardchanged identity → the lifecycle effect's dep (syncRemoteClipboardToLocal) changed → full VNC/WebSocket teardown and rebuild on every render cycle.URL parameter desync: Destructured
setSearchParamsfromuseSearchParams()and called it after the mutation succeeds (NotificationsPage.tsx:79,90,98). Thedisabledquery param was deleted from a localURLSearchParamscopy but never persisted to the URL bar. Also fixed the effect dependency array fromsearchParams.delete(a stable method ref) tosearchParamsso it re-fires when the params change.Unhandled promise rejections from
mutateAsync: ReplacedmutateAsync()withmutate()across 3 agent settings pages (AgentSettingsModelsPage.tsx,AgentSettingsCompactionPage.tsx,AgentSettingsMCPServersPage.tsx).mutateAsync()returns a Promise — the callbacks had no.catch()ortry/catch, causingunhandledrejectionevents on API failures.mutate()surfaces errors through react-query'smutation.errorstate, which was already being consumed.