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.
In § 9. RTCIceTransport extensions between two "When the ICE agent [does X]" sections, it says:
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 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 itself.
Assuming there is no limit on when this method can be called, I'll do a PR to that effect.