Repository navigation
fix: own server request and response lifetimes - #74
Merged
Merged
Conversation
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.
Request bodies could hang on cancellation, HEAD and discarded middleware responses could retain streams, and invalid access-denial results could execute the protected handler. Own those lifetimes, reject invalid response/probe values, and propagate a failing onError callback once per request.
Retire saved middleware continuations, preserve transferred/cloned response bodies, and keep cached body failures handled. Correct benchmark fixtures that silently dispatched 404s and include benchmark sources in typechecking. Ship the hardening evidence and add coverage plus normal packed-install gates.
Validation: clean Node 24.21.0 npm ci, format check and npm run check pass: 465 unit cases, V8 floors, strict declarations, publint/artifact checks, and all nine normally installed entrypoints with native lifecycle probes. npm audit reports zero findings; ten production lock entries are unchanged. Initial regressions and subsequent review probes were demonstrated failing before their fixes.
Corrected-fixture local pairs measured JSON/form binding about 0.5-0.6 microseconds slower and two-middleware dispatch about 0.1-0.15 microseconds slower. These are measured correctness costs, with no optimization or capacity claim. Full scenarios and partial coverage are recorded in docs/0.5.0-hardening.md.
Refs #73. Keep #73 open for real Node listener/connection-cleanup qualification and the final candidate checks. API contraction #72 is separate. Version remains 0.4.1 during preparation; official publication requires the maintainer's full review of the frozen 0.5.0 candidates.