You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
terminate active multipart file callbacks when a parser limit is reached or input ends unexpectedly
stop parsing consistently after total-size and per-part limit failures
propagate FileTooLarge, BodyTooLarge, and truncated-body parse failures through the multipart wrapper without hanging
add a patch changeset for the user-visible fix
Root cause
After a file part had been emitted, terminal parser errors did not send the file callback its final null chunk. The file stream therefore kept pumping an already-stopped or exhausted parser indefinitely instead of allowing the outer multipart stream to surface the failure.
The total-size path also did not mark parsing as stopped, so later parser errors could replace the original MaxTotalSize failure. All terminal limit paths now share one stop operation, and truncated input routes through it as well.
Validation
pnpm check
pnpm vitest run packages/effect/test/unstable/http/Multipart.test.ts (13 tests)
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
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.
Summary
FileTooLarge,BodyTooLarge, and truncated-body parse failures through the multipart wrapper without hangingRoot cause
After a file part had been emitted, terminal parser errors did not send the file callback its final
nullchunk. The file stream therefore kept pumping an already-stopped or exhausted parser indefinitely instead of allowing the outer multipart stream to surface the failure.The total-size path also did not mark parsing as stopped, so later parser errors could replace the original
MaxTotalSizefailure. All terminal limit paths now share one stop operation, and truncated input routes through it as well.Validation
pnpm checkpnpm vitest run packages/effect/test/unstable/http/Multipart.test.ts(13 tests)pnpm exec changeset status --since origin/mainpnpm exec oxlint packages/effect/src/unstable/http/MultipartParser/internal/multipart.ts packages/effect/test/unstable/http/Multipart.test.tspnpm exec dprint check packages/effect/src/unstable/http/MultipartParser/internal/multipart.ts packages/effect/test/unstable/http/Multipart.test.ts .changeset/fix-multipart-file-stream-limits.mdCloses EFF-573