Bug 173118

Summary: RTCPeerConnection returns RTCSessionDescription where RTCSessionDescriptionInit would be appropriate
Product: WebKit Reporter: Stefan Fochler <stefanf>
Component: MediaAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, eric.carlson, jonlee, rniwa, stefanf, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac   
OS: macOS 10.12   
See Also: https://bugs.webkit.org/show_bug.cgi?id=169816
Bug Depends on:    
Bug Blocks: 169644    
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews122 for ios-simulator-wk2
none
Archive of layout-test-results from ews105 for mac-elcapitan-wk2
none
Patch for landing none

Description Stefan Fochler 2017-06-08 15:30:32 PDT
Overview:
Calls to createOffer (and possibly createAnswer, too) on instances of RTCPeerConnection return a Promise<RTCSessionDescription> instead of the Promise<RTCSessionDescriptionInit> (note the -Init) as per spec (https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#interface-definition).

Steps to Reproduce:
1. Open codepen https://codepen.io/anon/pen/jwWPMq?editors=1011 in Safari TP 33
2. Notice how the function fails to log the second line because offer.sdp cannot be set on RTCSessionDescriptions

Actual Result:
RTCPeerConnection#createOffer returns a Promise that resolves to a RTCSessionDescription object with readonly properties.

Expected Result:
RTCSessionDescriptions returned from createOffer (and possibly createAnswer, untested) should be RTCSessionDescriptionInits instead so that the properties can be modified.

This breaks not only our internal code that I cannot disclose here (hence the codepen), but also sites like https://webrtc.github.io/samples/src/content/peerconnection/munge-sdp/.

Build Date & Hardware:
Safari TP 33 on macOS 10.12.5
Comment 1 Radar WebKit Bug Importer 2017-06-13 13:12:44 PDT
<rdar://problem/32746761>
Comment 2 youenn fablet 2017-06-13 16:03:04 PDT
Created attachment 312823 [details]
Patch
Comment 3 Build Bot 2017-06-13 17:30:01 PDT
Comment on attachment 312823 [details]
Patch

Attachment 312823 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/3926085

New failing tests:
imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createOffer.html
Comment 4 Build Bot 2017-06-13 17:30:02 PDT
Created attachment 312835 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.5
Comment 5 Build Bot 2017-06-13 18:46:19 PDT
Comment on attachment 312823 [details]
Patch

Attachment 312823 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/3926562

New failing tests:
fast/mediastream/RTCPeerConnection-setRemoteDescription-offer.html
fast/mediastream/RTCPeerConnection-setLocalDescription-offer.html
imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createOffer.html
Comment 6 Build Bot 2017-06-13 18:46:21 PDT
Created attachment 312845 [details]
Archive of layout-test-results from ews105 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 7 youenn fablet 2017-06-14 02:15:11 PDT
Created attachment 312874 [details]
Patch for landing
Comment 8 youenn fablet 2017-06-14 02:18:57 PDT
Thanks for the review.

> New failing tests:
> fast/mediastream/RTCPeerConnection-setRemoteDescription-offer.html
> fast/mediastream/RTCPeerConnection-setLocalDescription-offer.html

The changes there show that we are no longer returning RTCSessionDescription.
That said, we are still failing some assertions in these. Should be investigated further

> imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createOffer.html

Going from FAIL to PASS :)
Comment 9 WebKit Commit Bot 2017-06-15 09:24:24 PDT
Comment on attachment 312874 [details]
Patch for landing

Clearing flags on attachment: 312874

Committed r218335: <http://trac.webkit.org/changeset/218335>
Comment 10 WebKit Commit Bot 2017-06-15 09:24:25 PDT
All reviewed patches have been landed.  Closing bug.