[webrtc-pc] Pull Request: Allow createAnswer to be called only in valid signaling state

soareschen has just submitted a new pull request for https://github.com/w3c/webrtc-pc:

== Allow createAnswer to be called only in valid signaling state ==
Fixes #1183.

This makes createAnswer throw `InvalidStateError` if the signaling state is not `have-remote-offer` or `have-local-pranswer`. Checking signaling state also implicitly assert that `pendingRemoteDescription` is set, so that checking is removed.

There is a breaking change here that existing implementations allow createAnswer to succeed after a call to `setLocalDescription(answer)`. Nevertheless the resulting new answer cannot be applied because the connection have transition  back to stable state. If anyone think it is important not to break this behavior, I am happy to modify the patch to only throw error if `pendingRemoteDescription` is not of type `offer`.

See https://github.com/w3c/webrtc-pc/pull/1549

Received on Wednesday, 23 August 2017 07:54:49 UTC