Skip to content

1.1.0#3

Merged
1ureka merged 2 commits intomainfrom
1.1.0
Mar 22, 2026
Merged

1.1.0#3
1ureka merged 2 commits intomainfrom
1.1.0

Conversation

@1ureka
Copy link
Copy Markdown
Owner

@1ureka 1ureka commented Mar 22, 2026

This pull request enhances the WebRTC signaling handshake by introducing a dual-flag mechanism to ensure both peers confirm that their DataChannels are open before proceeding. This improves the reliability of connection establishment by explicitly synchronizing readiness on both sides. Additionally, new logging and error handling have been added for better observability and robustness.

Key changes:

Dual-flag handshake for DataChannel readiness:

  • Introduced a new signaling message type (msgTypeReady) to indicate when a peer's DataChannel is open, and updated both host and client flows to wait for this confirmation from the remote peer before finalizing the connection. (internal/signaling/message.go, internal/signaling/signaling.go, internal/signaling/receiver.go, internal/signaling/sender.go) [1] [2] [3] [4] [5] [6] [7] [8] [9]

  • Updated the receiver struct to include a peerReady channel and modified the watch method to handle the new ready message type. (internal/signaling/receiver.go) [1] [2]

Improved error handling and timeouts:

  • Added a timeout (readyTimeout) when waiting for the peer's ready signal, and improved error handling and logging in both host and client establishment flows to handle negotiation failures and context cancellations more gracefully. (internal/signaling/signaling.go) [1] [2] [3] [4]

Logging enhancements:

  • Added debug and info logs for key events, including when the WebSocket server is closed and when negotiation steps succeed or fail. (internal/signaling/ws.go, internal/signaling/signaling.go) [1] [2] [3] [4]

@1ureka 1ureka merged commit fdd4086 into main Mar 22, 2026
1 check passed
@1ureka 1ureka deleted the 1.1.0 branch March 22, 2026 04:22
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.

1 participant