Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle ICE state and candidate pair changes in the same task #2444

Merged
merged 5 commits into from Jan 23, 2020
Merged

Handle ICE state and candidate pair changes in the same task #2444

merged 5 commits into from Jan 23, 2020

Conversation

henbos
Copy link
Contributor

@henbos henbos commented Jan 22, 2020

Fixes #2283.

If the selected candidate pair causes the ICE connection state to change, we surface all state changes first and fire all events later, in the following order:

  • transport.selectedcandidatepairchange
  • transport.statechange
  • connection.iceconnectionstatechange
  • connection.connectionstatechange

This gives a well-defined event firing order. It also makes it possible to inspect the state of the connection or transport and not find inconsistencies, e.g. in selectedcandidatepairchange we are guaranteed to see an up-to-date transport.state or vice versa.


Preview | Diff

@henbos
Copy link
Contributor Author

henbos commented Jan 22, 2020

Prior to this CL it would probably have been valid (up to interpretation) to update the ICE state first, fire an event, and then in a later task update the selected candidate pair and fire an event. Probably not intentional to be in a connected state while at the same time having a null candidate pair. This fixes that.

@aboba
Copy link
Contributor

aboba commented Jan 23, 2020

One thing I noticed is that the check for a closed RTCPeerConnection has been removed. Was this intentional?

@aboba aboba added Needs Test Needs a WPT test and removed Please take a look labels Jan 23, 2020
webrtc.html Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Test Needs a WPT test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Merge the steps for updating candidate pair and ice transport state
3 participants