webrtc: race condition during connection negotiation
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 1.8k
- Forks
- 320
- Avg merge
- 11d 15h
- Merged PRs (30d)
- 1
Description
When exchanging ICE candidates, the connectionStatus of one side becomes connected before the other.
At that point it closes the signalling stream (at the moment - see #580)
If this happens before it's sent its final ICE candidate, the remote's end of the stream can close mid-read and the remote's RTCPeerConnection may still have the connectionStatus of connecting.
This is handled in js by waiting for the connectionStatus of the RTCPeerConnection to change within a time out when the stream closes, even mid-read but is not reset. It works but it feels a bit hacky.
It's necessary in JS because the receiving of ICE candidates and the changes of connectionStatus on the local RTCPeerConnection are async and decoupled so may occur in any order.
Do we care about this or would it be better to add an additional, final message that can be sent over the signalling stream when one side's RTCPeerConnection becomes connected like SDP_COMPLETE or similar?
This message would mean 'this end is "connected", no more ICE candidates will be sent, the stream can/will be closed, and you should wait for your end to become "connected" or to time out'.
cc @sukunrt @mxinden @marten-seemann
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing signalling-stream behavior described in #580 and the issue's ICE-candidate and RTCPeerConnection sequence. Compare the current JavaScript timeout workaround with the proposed final signalling message, then define which protocol behavior should be specified and how both connection states should complete before the stream closes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- audio-video-rtc, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100