Skip to content

fix(transport): improve WebSocket/WebRTC connection robustness #3222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sujalsalekar
Copy link

Fixes #3221

Description
This PR improves the robustness of WebSocket and WebRTC connection establishment by adding proper error handling, timeouts, and retry mechanisms.

Changes

WebSocket Transport

Added retry mechanism (max 3 attempts with 1s delay)
Added connection timeout handling
Improved error handling with detailed error messages
Added connection state tracking
Added metrics for failure scenarios

WebRTC Transport

Added ICE gathering timeout (30s)
Added overall connection timeout (60s)
Added SDP answer timeout
Added connection state monitoring
Improved cleanup of event listeners
Added metrics for different failure scenarios

Testing
Tested connection establishment under poor network conditions
Verified retry mechanism works as expected
Confirmed proper cleanup after failed connections
Checked metrics are correctly reported

Related Issues
Closes #3221

@sujalsalekar sujalsalekar requested a review from a team as a code owner July 13, 2025 11:05
@achingbrain
Copy link
Member

Thank you for opening this PR.

Is this in response to an issue you’ve seen in a deployed application or are you just trying to make general improvements to the codebase?

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.

fix: Make WebSocket/WebRTC connection establishment more robust
2 participants