Repository navigation
jsonrpc: fire onClose from IPCMessageWriter and PortMessageReader - #1903
Merged
Dirk Bäumer (dbaeumer) merged 2 commits intoOct 21, 2026
Merged
Conversation
Their 'close' listeners returned this.fireClose instead of calling it, so the onClose event never fired. Symmetric IPC/Port reader-writer pairs still closed the connection through the other half, but direct onClose subscribers and mixed-transport connections got no close notification.
There was a problem hiding this comment.
🟢 Approval recommended
The focused fixes directly address the reported defect, with regression coverage and no unresolved findings.
No open issues 🎉
What changed in this PR
Fixes #1901 by restoring close notifications in two Node JSON-RPC transports.
Changes:
- Calls
fireClose()inIPCMessageWriterandPortMessageReader. - Adds regression tests checking reader and writer close notifications for both transports.
Tests were not run; the repository checkout was unavailable.
| File | Description |
|---|---|
| jsonrpc/src/node/test/connection.test.ts | Adds transport close-event regression tests. |
| jsonrpc/src/node/main.ts | Invokes the two previously uncalled close handlers. |
Review effort: Balanced
Dirk Bäumer (dbaeumer)
enabled auto-merge (squash)
October 21, 2026 06:34
Dirk Bäumer (dbaeumer)
approved these changes
Oct 21, 2026
Dirk Bäumer (dbaeumer)
approved these changes
Oct 21, 2026
Dmitriy Vasyura (dmitrivMS)
approved these changes
Oct 21, 2026
Nick Trogh (ntrogh)
approved these changes
Oct 21, 2026
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.
Fixes: #1901
IPCMessageWriterandPortMessageReaderinjsonrpc/src/node/main.tsregistered'close'listeners as() => this.fireClose, which returns the method without calling it. As a result, theironCloseevent never fired.Symmetric pairs (IPC reader + IPC writer, Port reader + Port writer) still closed the connection, because the other half fires
onClosecorrectly. Code that subscribes toonCloseon these classes directly, or that pairs one of them with a different transport, never got a close notification. In the mixed-transport case,MessageConnectionnever reachedClosed.