Re: [webrtc-pc] Missing url in RTCIceCandidateInit (#2795)

> The spec clearly supports this assumption as it states that all attributes are derived from candidate except candidate, sdpMid, sdpMLineIndex and usernameFragment.

You're correct [it says](https://w3c.github.io/webrtc-pc/#rtcicecandidate-interface) _"Other than [candidate](https://w3c.github.io/webrtc-pc/#dom-rtcicecandidateinit-candidate), [sdpMid](https://w3c.github.io/webrtc-pc/#dom-rtcicecandidateinit-sdpmid), [sdpMLineIndex](https://w3c.github.io/webrtc-pc/#dom-rtcicecandidateinit-sdpmlineindex), and [usernameFragment](https://w3c.github.io/webrtc-pc/#dom-rtcicecandidateinit-usernamefragment), the remaining attributes are derived from parsing the [candidate](https://w3c.github.io/webrtc-pc/#dom-rtcicecandidateinit-candidate) member in candidateInitDict, if it is well formed."_, which https://github.com/w3c/webrtc-pc/pull/2763 broke. We at minimum need a PR to fix that sentence unless we revert both `relayProtocol` and `url`.

> It is obviously unfair to say that it is safe to do it for url given we have done it for relayProtocol, none of them have been implemented yet AFAIK.

What does "safe" mean? What's an example of a web compat pattern that would break?

> Maybe we should have introduced a RTCIceLocalCandidate that could be partially exported to a RTCIceCandidateInit, representing a remote candidate. This model seems cleaner to me.

It might be worth looking at why we have an interface at all:
 1. `event.candidate` cannot be a dictionary 
 2. It's a convenient candidate string parser: e.g. `new RTCIceCandidate(candidate).foundation`

Number 2 is likely the only reason we didn't [deprecate the constructor like we did for RTCSessionDescription](https://w3c.github.io/webrtc-pc/#dom-sessiondescription) in https://github.com/w3c/webrtc-pc/pull/302, and I don't see how the lack of `relayProtocol` and `url` would impact that use case.

One benefit of keeping them where they are would be having them appear in the result from [getLocalCandidates()](https://w3c.github.io/webrtc-pc/#dom-rtcicetransport-getlocalcandidates):
```js
const [{relayProtocol, url}] = sender.transport.iceTransport.getLocalCandidates();
```
They would obviously be `null` in getRemoteCandidates().

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2795#issuecomment-1320508754 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 18 November 2022 20:49:37 UTC