Skip to content

Fix pending WebSocket protocol commands on disconnect - #44

Merged
seclerp merged 2 commits into
seclerp:mainfrom
Solution-lab:master
Jun 29, 2026
Merged

seclerp merged 2 commits into
seclerp:mainfrom
Solution-lab:master

Conversation

@Solution-lab

Copy link
Copy Markdown
Contributor

Summary

Fixes WebSocketProtocolClient.SendCommandAsync hanging indefinitely when the underlying WebSocket connection is closed before a command response is received.

Changes

  • Complete pending command response tasks when the protocol connection is closed.
  • Honor CancellationToken while waiting for command responses.
  • Prevent new commands from being queued after the client has been disposed.
  • Add regression tests for cancellation, connection close, and post-dispose command calls.

@seclerp seclerp left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! Please find my comments below.

Comment thread src/ChromeProtocol.Runtime/Messaging/WebSockets/WebSocketProtocolClient.cs Outdated
Comment thread src/ChromeProtocol.Runtime/Messaging/WebSockets/WebSocketProtocolClient.cs Outdated
@seclerp
seclerp merged commit d0bd482 into seclerp:main Jun 29, 2026
4 checks passed
@seclerp

seclerp commented Jun 29, 2026

Copy link
Copy Markdown
Owner

LGTM, thanks!

@Solution-lab

Copy link
Copy Markdown
Contributor Author

You're welcome! Thank you for maintaining this repository, happy to contribute.

@Solution-lab
Solution-lab deleted the master branch June 29, 2026 22:26
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