chore: bump plug to 1.20.3 (fix Phoenix logger detach on WS upgrade) - #1125
Merged
Conversation
Plug 1.20.0 began running before_send callbacks on connection upgrade. The GET /v2 websocket route upgrades via Plug.Conn.upgrade_adapter/3 without setting conn.status, so Phoenix's [:phoenix,:endpoint,:stop] telemetry handler hit Plug.Conn.Status.code(nil) and raised :function_clause. :telemetry then permanently detached that global handler node-wide, stopping all per-request Phoenix logging until restart. Plug 1.20.2 (elixir-plug/plug#1320) defaults conn.status to 101 before running before_send on upgrade, so the handler never sees nil. Bump to 1.20.3, which also carries CVE fixes. Transitive dep, mix.lock only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DuxufDmqyTd3iswyfg5msD
v0idpwn
marked this pull request as ready for review
July 23, 2026 19:35
v0idpwn
enabled auto-merge (squash)
July 23, 2026 19:35
v0idpwn
approved these changes
Jul 23, 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.
Requested by Jefferson Venerando, Felipe Stival · Slack thread
Before
After the Plug 1.20 bump (shipped in v2.9.9), a websocket upgrade on
GET /v2leavesconn.statusnil. Plug 1.20.0 newly runsbefore_sendcallbacks onPlug.Conn.upgrade_adapter/3, which fires Phoenix's[:phoenix, :endpoint, :stop]telemetry handler whileconn.statusis stillnil. That handler callsPlug.Conn.Status.code(nil), which raises:function_clause. Erlang:telemetrythen permanently detaches the failing handler node-wide, so all per-request Phoenix logs stop appearing in Logflare until the node restarts.The offending route is
lib/supavisor_web/ws_proxy.ex, which upgrades viaPlug.Conn.upgrade_adapter/3without setting a status.After
Bumping
plugto 1.20.3 makes upgrades defaultconn.statusto101before runningbefore_send(Plug #1320), so the telemetry handler never seesnil, never raises, and request logging keeps working. 1.20.3 also carries CVE fixes.How
Single-line
mix.lockbump ofplugfrom 1.20.1 to 1.20.3.plugis a transitive dependency (viaphoenix/plug_cowboy), so there is nomix.exschange and no application code change.Refs:
Generated by Claude Code