Bug 173118 - RTCPeerConnection returns RTCSessionDescription where RTCSessionDescriptionInit would be appropriate
Summary: RTCPeerConnection returns RTCSessionDescription where RTCSessionDescriptionIn...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari Technology Preview
Hardware: Mac macOS 10.12
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks: 169644
  Show dependency treegraph
 
Reported: 2017-06-08 15:30 PDT by Stefan Fochler
Modified: 2017-06-15 09:24 PDT (History)
8 users (show)

See Also:


Attachments
Patch (6.64 KB, patch)
2017-06-13 16:03 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews122 for ios-simulator-wk2 (919.10 KB, application/zip)
2017-06-13 17:30 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews105 for mac-elcapitan-wk2 (1.11 MB, application/zip)
2017-06-13 18:46 PDT, Build Bot
no flags Details
Patch for landing (11.31 KB, patch)
2017-06-14 02:15 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.