Skip to content

fix(stream-transform): handle promise rejections without leaking - #508

Open
jakezwang wants to merge 1 commit into
adaltas:masterfrom
jakezwang:fix-transform-promise-rejections
Open

jakezwang wants to merge 1 commit into
adaltas:masterfrom
jakezwang:fix-transform-promise-rejections

Conversation

@jakezwang

Copy link
Copy Markdown

Handle a rejected async transform handler in the same then call as its fulfillment. Attaching catch to the original promise leaves the promise returned by then unhandled, so a process can terminate even after the callback or pipeline has received the error.

Adds callback and pipeline regressions in child processes with --unhandled-rejections=strict; both fail before the fix and pass afterward. The original error is preserved.

Validation: stream-transform's 79 tests and type checks pass on Node 20, 22 and 24; package lint and build pass. Full workspace npm test passes on Node 24 (1,047 passing, 6 existing pending). Root lint still reports 5 errors and 6 warnings in unchanged packages, identical to an unmodified-source run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant