New issue
Advanced search Search tips

Issue 699036 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

WebRTC: dont fire events from pc.close

Project Member Reported by philipp....@googlemail.com, Mar 7 2017

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.

 
Owner: hbos@chromium.org
Status: Assigned (was: Unconfirmed)
hbos@: can you take a look?
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

Comment 3 by guidou@chromium.org, Mar 13 2018

hbos@: Is this still valid?

Comment 4 by fi...@appear.in, Mar 13 2018

https://github.com/w3c/webrtc-pc/issues/1799 -- came up less than 24 hours ago :-)

Comment 5 by hbos@chromium.org, Mar 14 2018

Still valid then :)

Sign in to add a comment