Bump express to 5.2.1#1486
Merged
Merged
Conversation
…erver - Rename /sessions/* catch-all to /sessions/*splat (path-to-regexp v8 requires named wildcards) - Add terminal error middleware: logs forwarded async route errors and returns JSON 500 instead of killing the process Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Why
On Express 4, a rejected promise from an
asyncroute handler becomes an unhandled rejection, which kills the whole process on Node ≥15. Several handlers (e.g./repo/describe) haveawaits or throwing calls before theirtryblocks, so one bad request could take down the server (see #1485 for the specific instance). Express 5 forwards async handler rejections to error middleware, closing the whole bug class at once.Changes
express4.22.1 → 5.2.1 (pinned).@types/expresswas already at 5.0.6; no type changes needed.@modelcontextprotocol/sdkalready depends on express 5, so the tree now dedupes to a single copy — the lockfile diff is just express 4's transitive tree being removed./sessions/*→/sessions/*splat(path-to-regexp v8 requires named wildcards; the old syntax throws at boot). Only route in the repo affected — no other wildcards, optional params, regex paths, or removed APIs (req.param,res.sendfile, etc.) in use.Verification
/health, param routes, 404s, and validation 400s behave as beforePOST /repo/describewith a model whose provider has no API key — now returns a JSON 500 with the error logged, and the server stays up/sessions/foo/barmatches through the renamed wildcard routetest:nodesuite: 231/231 passexpress.urlencodedalready passesextended: trueexplicitly🤖 Generated with Claude Code