You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"An RTCPeerConnection object has an aggregated [[ConnectionState]]. Whenever the state of an RTCDtlsTransport changes or when the [[IsClosed]] slot turns true, the user agent MUST update the connection state by queueing a task that runs the following steps:
This directly contradicts 4.4.4 Garbage collection:
"An RTCPeerConnection object MUST not be garbage collected as long as any event can cause an event handler to be triggered on the object. When the object's [[IsClosed]] internal slot is true, no such event handler can be triggered and it is therefore safe to garbage collect the object."
In addition, most places suppress event firing when [[IsClosed]] is true. There are some exceptions, though, and those are likely bugs too. Just grep through for "Fire an event" and find the places that don't do an [[IsClosed]] check.
The text was updated successfully, but these errors were encountered:
Based on https://jsfiddle.net/jib1/dpxq5nvr/30 (click the Close! button) it looks like no browser fires the connectionstatechange on pc.close(). So we probably want to align the spec with implementations here.
That said, they all appear to fire statechange on sender.transport on pc.close(), so we probably want to keep that. But that's a different section.
That said, they all appear to fire statechange on sender.transport on pc.close(), so we probably want to keep that.
@docfaraday Given that we're likely to keep this exception, I don't think we can do a PR to blanket suppress event firing when [[IsClosed]] is true. I think we have to open an issue for each one and consider its web compat impact.
From 4.4.1.3 Update the connection state:
"An RTCPeerConnection object has an aggregated [[ConnectionState]]. Whenever the state of an RTCDtlsTransport changes or when the [[IsClosed]] slot turns true, the user agent MUST update the connection state by queueing a task that runs the following steps:
Let connection be this RTCPeerConnection object.
Let newState be the value of deriving a new state value as described by the RTCPeerConnectionState enum.
If connection.[[ConnectionState]] is equal to newState, abort these steps.
Set connection.[[ConnectionState]] to newState.
Fire an event named connectionstatechange at connection."
This directly contradicts 4.4.4 Garbage collection:
"An RTCPeerConnection object MUST not be garbage collected as long as any event can cause an event handler to be triggered on the object. When the object's [[IsClosed]] internal slot is true, no such event handler can be triggered and it is therefore safe to garbage collect the object."
In addition, most places suppress event firing when [[IsClosed]] is true. There are some exceptions, though, and those are likely bugs too. Just grep through for "Fire an event" and find the places that don't do an [[IsClosed]] check.
The text was updated successfully, but these errors were encountered: