Skip to content

fix(connection): register protocol callback only after successful send - #3167

Merged
Skn0tt merged 2 commits into
microsoft:mainfrom
Skn0tt:skn0tt-fix-3165-register-callback-after-send
Aug 5, 2026
Merged

fix(connection): register protocol callback only after successful send#3167
Skn0tt merged 2 commits into
microsoft:mainfrom
Skn0tt:skn0tt-fix-3165-register-callback-after-send

Conversation

@Skn0tt

@Skn0tt Skn0tt commented Aug 4, 2026

Copy link
Copy Markdown
Member

If transport.send fails (e.g. non-JSON-serializable params), we used to leave a ProtocolCallback sitting in connection._callbacks. cleanup() later set_exceptions on it, and nobody awaits it → Future exception was never retrieved.

Fix is to register the callback only after a successful send.

Fixes one of the two cases of #3165

Skn0tt and others added 2 commits August 4, 2026 17:06
Fixes one of the two cases of microsoft#3165

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 358aa828-ed44-482a-8a83-91d435d25b38
The sync subprocess test already covers the user-visible warning.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 358aa828-ed44-482a-8a83-91d435d25b38
@Skn0tt
Skn0tt requested a review from dcrousso August 4, 2026 16:14
@Skn0tt
Skn0tt merged commit 4d2e058 into microsoft:main Aug 5, 2026
35 checks passed
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.

2 participants