New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 632457 link

Starred by 3 users

Issue metadata

Status: Verified
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Regression: Uncaught (in promise) TypeError thrown during a peerconnection

Project Member Reported by srnarayanan@chromium.org, Jul 28 2016

Issue description

Version: M54 Canary 54.0.2810.2
OS: Mac

What steps will reproduce the problem?
(1) Open the peerconnection audio sample page https://webrtc.github.io/samples/src/content/peerconnection/audio/
(2) Click 'Call' 
(3) Keep an eye on the JS console

What is the expected output?
The call connects and no JS errors should be seen

What do you see instead?
Uncaught (in promise) TypeError: Failed to execute 'getStats' on 'RTCPeerConnection': parameter 2 is not of type 'MediaStreamTrack'.
error thrown
Screenshots attached 

Please use labels and text to provide additional information.
1. This error is seen in the WebRTC Troubleshooter page as well
2. This is a regression from yesterday's canary 54.0.2809.0 
Bisect info - 

You are probably looking for a change made after 408095 (known good), but no later than 408100 (first known bad).
CHANGELOG URL:
  https://chromium.googlesource.com/chromium/src/+log/27ad5b198a71390175560f35b32d221331f53af5..65f0f9bcaabb68512ce76b923bc9f3305b235b8d 
suspecting https://chromium.googlesource.com/chromium/src/+/08fa67b0f718b342b8c47725f2018c63ade8b699
 
Screen Shot 2016-07-28 at 12.42.32 PM.png
249 KB View Download
Screen Shot 2016-07-28 at 12.28.21 PM.png
165 KB View Download
Labels: OS-Linux OS-Windows
Status: Assigned (was: Untriaged)
It's definitely this change: https://chromium.googlesource.com/chromium/src/+/08fa67b0f718b342b8c47725f2018c63ade8b699.

We will probably have to updated TestRTC and adapter.js for this.


Cc: hbos@chromium.org
Owner: jansson@chromium.org
Forgot to mention that I will take a look at those today.

Comment 4 by hbos@chromium.org, Jul 29 2016

Cc: hta@chromium.org foolip@chromium.org
In my CL,
  [CallWith=ExecutionContext, LegacyInterfaceTypeChecking] void getStats(RTCStatsCallback successCallback, [Default=Undefined] optional MediaStreamTrack selector);
Changed into:
  [CallWith=ScriptState] Promise<void> getStats(RTCStatsCallback successCallback, optional MediaStreamTrack? selector);

It still expects two arguments of the same types but it no longer has [LegacyInterfaceTypeChecking] and [Default=Undefined]. I believe this change was necessary when overloading getStats (which I did by adding a promise-based getStats).
In adapter.js:238, getStats is called with arguments "getStats(successCallback, rejectCallback)". We don't and never did support a rejectCallback, so I'm guessing that the [LegacyInterfaceTypeChecking] and [Default=Undefined] saw that rejectCallback didn't match and turned it into an undefined value instead? Otherwise this shouldn't have worked in the first place.

My CL wasn't suppose to break existing usage but in this case it did. If it failed because we were trying to call it with unexpected arguments already then I think it's fair to say that the calling place should be updated and that we don't need to accommodate for calling cases such as this? Otherwise overloading getStats probably gets messy again.

Comment 5 by hbos@chromium.org, Aug 1 2016

I was able to re-add LegacyInterfaceTypeChecking and overloading still works: https://codereview.chromium.org/2198123002/

Comment 6 by hbos@chromium.org, Aug 1 2016

Owner: hbos@chromium.org
Status: Started (was: Assigned)
hbos@ - I no longer see the info overlay in apprtc calls (by pressing "i" during the call). 
Is this related to your change as well?

Comment 8 by srcv@chromium.org, Aug 1 2016

Labels: OS-Chrome
This issue is also observed on Chrome OS.

Comment 9 by hbos@chromium.org, Aug 2 2016

#7 srnayanan@ - Yes, same reason.

I have confirmed that this is the cause and that my CL fixes it. It's in the CQ.
Project Member

Comment 10 by bugdroid1@chromium.org, Aug 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7a4e83b57886f79649c47c8f3476ac961f291d07

commit 7a4e83b57886f79649c47c8f3476ac961f291d07
Author: hbos <hbos@chromium.org>
Date: Tue Aug 02 10:38:19 2016

RTCPeerConnection.getStats gets LegacyInterfaceTypeChecking.

This tag was removed in https://codereview.chromium.org/2156063002/
which caused a regression ( crbug.com/632457 ). This CL re-adds it to
solve that regression. The generated bindings code is able to
call the correct overloaded getStats function with or without it.

LegacyInterfaceTypeChecking means any (nonsense) argument can be passed
as the second parameter and if its not a MediaStreamTrack it is
interpreted as null. This was something adapter.js relied on.

BUG= 632457 ,  627816 

Review-Url: https://codereview.chromium.org/2198123002
Cr-Commit-Position: refs/heads/master@{#409167}

[modify] https://crrev.com/7a4e83b57886f79649c47c8f3476ac961f291d07/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-stats-expected.txt
[modify] https://crrev.com/7a4e83b57886f79649c47c8f3476ac961f291d07/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-stats.html
[modify] https://crrev.com/7a4e83b57886f79649c47c8f3476ac961f291d07/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.idl

Comment 11 by hbos@chromium.org, Aug 2 2016

Status: Verified (was: Started)
Fixed, it works.
Issue 633742 has been merged into this issue.
Looks good in M54 Canary 54.0.2817.0 - No JS errors

Tested sample pages -
https://test.webrtc.org/
https://webrtc.github.io/samples/src/content/peerconnection/audio/
https://webrtc.github.io/samples/src/content/peerconnection/bandwidth/

The info overlay in apprtc calls (by pressing "i" during the call) is back, with stats! 

Comment 14 by hbos@chromium.org, Aug 4 2016

Awesome, thanks for testing :)

Sign in to add a comment