WebRTC: dont fire events from pc.close |
|
Issue description
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/56.0.2924.76 Chrome/56.0.2924.76 Safari/537.36
Steps to reproduce the problem:
var pc = new RTCPeerConnection();
pc.addEventListener('signalingstatechange', (e) => console.log(pc.signalingState));
pc.close();
What is the expected behavior?
signalingstatechange should not be called.
What went wrong?
signalingstatechange is called. This is no longer proper behaviour per spec.
Did this work before? No
Does this work in other browsers? N/A
Chrome version: 56.0.2924.76 Channel: n/a
OS Version:
Flash Version: Shockwave Flash 16.0 r0
In https://codereview.chromium.org/2677233002/#msg21 hbos said:
This made me think of this discussion,
"pc.close() is always user-invoked now, and by design we don't fire events on
user-invoked actions."
https://github.com/w3c/webrtc-pc/issues/1020
For Chrome it means that the change*State from closeInternal need to go away afaics.
Basically this should not call the event listener:
var pc = new RTCPeerConnection();
pc.addEventListener('signalingstatechange', (e) => console.log(pc.signalingState));
pc.close();
(this is easily written as a wpt test!)
I know that I have code relying heavily on this here:
https://github.com/opentok/rtcstats/blob/master/rtcstats.js#L272-L276
so if we do this we need to do it in all browsers (also MSFTs 1.0; ideally without them shipping this in a stable version...) and communicate the change.
,
Mar 7 2017
Note the "closed" signalingState is gone in the spec [1]. Moved to connectionState [2]. Same issue there though. [1] http://w3c.github.io/webrtc-pc/#rtcsignalingstate-enum [2] http://w3c.github.io/webrtc-pc/#rtciceconnectionstate-enum
,
Mar 13 2018
hbos@: Is this still valid?
,
Mar 13 2018
https://github.com/w3c/webrtc-pc/issues/1799 -- came up less than 24 hours ago :-)
,
Mar 14 2018
Still valid then :)
,
Jun 2 2018
related: https://cs.chromium.org/chromium/src/content/renderer/media/webrtc/rtc_peer_connection_handler.cc?q=signalingstatechange&sq=package:chromium&dr=C&l=1972 any reason why this updates webrtc-internals when closed? |
|
►
Sign in to add a comment |
|
Comment 1 by guidou@chromium.org
, Mar 7 2017Status: Assigned (was: Unconfirmed)