Re: [webrtc-extensions] Add steps to clear [[CandidatePairs]] in response to ICE restart (#196)

Clearing of [[[CandidatePairs]]](https://w3c.github.io/webrtc-extensions/#dfn-candidatepairs) during an ICE restart is not explicitly covered by the existing steps, but it aught to be.

An ICE restart causes the ICE agent to discard existing candidate pairs, regather candidates and re-form check lists. From [RFC 8445 section 9](https://www.rfc-editor.org/rfc/rfc8445#section-9):

> An ICE restart causes all previous states of the data streams, excluding the roles of the agents, to be flushed.

Or even more detailed from [RFC 5245 section 9.3.1.1](https://www.rfc-editor.org/rfc/rfc5245#section-9.3.1.1):

> ...the agent MUST flush the valid and check lists, and then recompute the check list and its states...

When candidates are regathered and candidate pairs are [formed](https://www.rfc-editor.org/rfc/rfc8445#section-6.1.2.2) again after an ICE restart, [[CandidatePairs]] will be populated with the new pairs and `icecandidatepairadd` will be fired for each of them.

So [[CandidatePairs]] should certainly be cleared beforehand. But also for the sake of consistency and continuity in the application, `icecandidatepairremove` should be fired for every active candidate pair removed by the ICE agent during the ICE restart.

The current language in the spec for [firing of `icecandidatepairremove`](https://w3c.github.io/webrtc-extensions/#rtcicetransport-remove) can be improved to make it clear that the event is indeed fired in the event of an ICE restart.

The spec should also make it clear that the event is not cancelable in the event of an ICE restart.

On a related note, `icecandidatepairremove` should not be fired when the peer connection is closed. The algorithm for [closing the connection](https://w3c.github.io/webrtc-pc/#dfn-close-the-connection) suppresses the firing of events _(except where the events are connected with the closing of a media source)_, and there is no reason to make an exception for `icecandidatepairremove`.

-- 
GitHub Notification of comment by sam-vi
Please view or discuss this issue at https://github.com/w3c/webrtc-extensions/issues/196#issuecomment-2045046379 using your GitHub account


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

Received on Tuesday, 9 April 2024 12:22:13 UTC