[webrtc-extensions] What happens if setSelectedCandidatePair() is called early? (#180)

jan-ivar has just created a new issue for https://github.com/w3c/webrtc-extensions:

== What happens if setSelectedCandidatePair() is called early?  ==
In [ยง 9. RTCIceTransport extensions](https://w3c.github.io/webrtc-extensions/#rtcicetransport) between two _"When the [ICE agent](https://w3c.github.io/webrtc-extensions/#dfn-ice-agent) [does X]"_ sections, it says:
- _"If the application defers the [nomination](https://w3c.github.io/webrtc-extensions/#dfn-nominate) of a candidate pair by cancelling the [icecandidatepairnominate](https://w3c.github.io/webrtc-extensions/#dfn-icecandidatepairnominate) event, it may select a different candidate pair to send data by calling [setSelectedCandidatePair](https://w3c.github.io/webrtc-extensions/#dom-rtcicetransport-setselectedcandidatepair)."_

We should reserve "may" and "MAY" for implementations and avoid using it to describe requirements on applications.

The intent of this statement is also unclear, since an application can call a method at any time. If we meant for this method to throw or reject if called outside this condition, that needs to go into its algorithm.

Also, the [change the selected candidate pair](https://w3c.github.io/webrtc-extensions/#rtcicetransport-select) algorithm itself has some bugs, like inferring _transport_ from the passed-in candidatePair.

I think it's better to move this algorithm to the method section.

Assuming there is no limit on when this method can be called, I'll do a PR to that effect.

Please view or discuss this issue at https://github.com/w3c/webrtc-extensions/issues/180 using your GitHub account


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

Received on Monday, 30 October 2023 22:20:20 UTC