fix(nodejs): handle stdio stdin errors#1584
Open
sjh9714 wants to merge 1 commit into
Open
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.
Summary
Fixes #1427.
Unexpected
stdinpipe errors from a spawned stdio runtime no longer get re-thrown from the EventEmitter error listener. The Node SDK now routes that condition through connection disposal, preserving theforceStop()guard and letting the existing JSON-RPC close/error handlers tear the client down.Changes
stdinerror rethrow with scoped connection disposal.stdinand verifies the SDK does not throw and disposes the connection.Testing
npm cifromnodejs/npm cifromtest/harness/npm test -- test/client.test.ts -t "disposes the stdio connection when child stdin emits an error"fromnodejs/(failed before the fix, passed after)npm test -- test/client.test.tsfromnodejs/npm test -- --exclude 'test/e2e/**'fromnodejs/npm run lintfromnodejs/npm run typecheckfromnodejs/npm run format:checkfromnodejs/npm run buildfromnodejs/git diff --checkgit diff --check origin/main...HEADFull e2e tests were not run locally.
Note: I used Codex while preparing this change, reviewed the final diff, and ran the listed checks locally.