Closed Bug 856425 Opened 13 years ago Closed 13 years ago

onicecandidate fails to fire in simple local to remote peer handshake with custom STUN server (see testcase)

Categories

(Core :: WebRTC, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla22
Tracking Status
firefox22 --- fixed

People

(Reporter: jsmith, Assigned: abr)

References

Details

(Keywords: testcase, Whiteboard: [webrtc][blocking-webrtc+][parity-chrome][spec-issue])

Attachments

(2 files, 2 obsolete files)

Attached file Test Case (obsolete) —
Steps: 1. Load the attached test case in Firefox 2. Watch the alert dialogs that fire 3. Run the same test case in Chrome Expected: We should get the same behavior in Chrome and Firefox. On Firefox's side, I would have expected onicecandidate to fire upon setLocalDescription being called on the local peer. Actual: onicecandidate never fires in Firefox after calling setLocalDescription, but it will fire in Chrome doing that same test case. In general, the behavior Firefox does here is almost completely different than Chrome. Firefox basically does: 1. local pc createOffer 2. local pc setLocalDescription 3. remote pc setRemoteDescription 4. remote pc createAnswer 5. remote pc setLocalDescription 6. local pc setRemoteDescription With each onicecandiate event handler never firing. Chrome's behavior however is entirely different: 1. local pc create offer 2. local pc setLocalDescription 3. local pc onicecandidate fired console logs: a=candidate:505434299 1 udp 2113937151 192.168.1.6 62237 typ host generation 0 audio 0 4. local pc onicecandidate fired console logs: a=candidate:505434299 1 udp 2113937151 192.168.1.6 62237 typ host generation 0 audio 0 5. local pc onicecandidate fired console logs: a=candidate:3078610798 1 udp 1845501695 98.248.43.172 62237 typ srflx raddr 192.168.1.6 rport 62237 generation 0 audio 0 6. local pc onicecandidate fired console logs: a=candidate:3078610798 1 udp 1845501695 98.248.43.172 62237 typ srflx raddr 192.168.1.6 rport 62237 generation 0 audio 0 7. local pc onicecandidate fired console logs: a=candidate:505434299 1 udp 2113937151 192.168.1.6 62237 typ host generation 0 audio 0 8. local pc onicecandidate fired console logs: a=candidate:505434299 1 udp 2113937151 192.168.1.6 62237 typ host generation 0 audio 0 9. local pc onicecandidate fired candidate is null in this case
Whiteboard: [parity-chrome]
ekr (or abr): how big an issue is this?
Flags: needinfo?(ekr)
Whiteboard: [parity-chrome] → [webrtc][blocking-webrtc?][parity-chrome][spec-issue]
Blocks: 850268
We need to generate an end of candidates indication, but not individual candidates. abr: isn't this a dupe of something else.
Flags: needinfo?(ekr)
Assignee: nobody → adam
Whiteboard: [webrtc][blocking-webrtc?][parity-chrome][spec-issue] → [webrtc][blocking-webrtc+][parity-chrome][spec-issue]
Keywords: testcase
Priority: -- → P2
To be clear, the spec does not say anything about onicecandidate being called with a null candidate once gathering is done; this is just something Chrome has decided to do, and several scripts rely on the behavior as a consequence. The generation of trickle candidates is covered by bug 842549. Until that lands, the repeated calls to onicecandidate will not happen. What is important, from a "compatibility with Chrome" perspective, is the null candidate generation. The current workaround, proposed by EKR, is to simply call onicecandidate with a null candidate every time setLocalDescription succeeds, immediately after the setRemoteDescription success callback. This is an easy fix.
(In reply to Adam Roach [:abr] from comment #3) > To be clear, the spec does not say anything about onicecandidate being > called with a null candidate once gathering is done; this is just something > Chrome has decided to do, and several scripts rely on the behavior as a > consequence. I retract this statement. It appears that the spec *does* document this. It simply does it in such a way that matches none of the search terms I was using.
Yes, I think it's clear that this is the required behavior.
(In reply to Adam Roach [:abr] from comment #3) > To be clear, the spec does not say anything about onicecandidate being > called with a null candidate once gathering is done; this is just something > Chrome has decided to do, and several scripts rely on the behavior as a > consequence. > > The generation of trickle candidates is covered by bug 842549. Until that > lands, the repeated calls to onicecandidate will not happen. What is > important, from a "compatibility with Chrome" perspective, is the null > candidate generation. Note that there is absolutely no requirement that we implement trickle ICE. The sole requirement is that we generate the final event that signals the end of gathering. > The current workaround, proposed by EKR, is to simply call onicecandidate > with a null candidate every time setLocalDescription succeeds, immediately > after the setRemoteDescription success callback. This is an easy fix.
Whiteboard: [webrtc][blocking-webrtc+][parity-chrome][spec-issue] → [webrtc][blocking-webrtc+][parity-chrome][spec-issue][webrtc-uplift]
Attached file Text case v2 (obsolete) —
The test case no longer works on nightly, as generation of an offer without any streams and without any constraints results in a failure. This testcase adds an "OfferToReceiveAudio" constraint to make the call succeed.
Attachment #731652 - Attachment is obsolete: true
Attached file Test Case v3
More fixes to the test. We can't really use alert(), since it hangs processing and perturbs the order of events; this outputs steps in the HTML body. This also fixes some issues where getting a null candidate causes the test to throw exceptions.
Attachment #735176 - Attachment is obsolete: true
Attachment #735209 - Flags: review?(ekr)
Comment on attachment 735209 [details] [diff] [review] Call onicecandidate with a null candidate immediately after setLocalDescription succeeds Review of attachment 735209 [details] [diff] [review]: ----------------------------------------------------------------- lgtm
Attachment #735209 - Flags: review?(ekr) → review+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Keywords: verifyme
Looks okay.
Status: RESOLVED → VERIFIED
Keywords: verifyme
Comment on attachment 735209 [details] [diff] [review] Call onicecandidate with a null candidate immediately after setLocalDescription succeeds [Approval Request Comment] Bug caused by (feature/regressing bug #): n/a User impact if declined: Various WebRTC applications tested with Chrome assume that an empty ice candidate message will be sent, making it hard to write applications that work with both FF and Chrome without sniffing and alternative flows. Testing completed (on m-c, etc.): on m-c Risk to taking this patch (and alternatives if risky): no risk String or IDL/UUID changes made by this patch: none
Attachment #735209 - Flags: approval-mozilla-aurora?
Attachment #735209 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Whiteboard: [webrtc][blocking-webrtc+][parity-chrome][spec-issue][webrtc-uplift] → [webrtc][blocking-webrtc+][parity-chrome][spec-issue]
Target Milestone: mozilla23 → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: