[webrtc-pc] Don't fire negotiationneeded outside of stable (#2471)

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

== Don't fire negotiationneeded outside of stable ==
https://github.com/w3c/webrtc-pc/pull/2405 added a chaining step to firing `negotiationneeded`, to avoid firing if negotiation has begun.

But chaining alone doesn't guarantee we'll be back in `"stable"`. More likely, we end up firing the event in `"have-local-offer"`, which is wrong.

At minimum we need a second

 1. If connection's signaling state is not "stable", abort these steps.

...step inside the queued task.

But perhaps we should move the call to [check if negotiation is needed](https://w3c.github.io/webrtc-pc/#dfn-check-if-negotiation-is-needed) in there as well? After all, by the time the queued task runs, the previous determination may no longer be accurate.

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

Received on Wednesday, 12 February 2020 22:17:10 UTC