<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>184688</bug_id>
          
          <creation_ts>2018-04-17 04:42:14 -0700</creation_ts>
          <short_desc>WebRTC DataChannel id of initiator not set</short_desc>
          <delta_ts>2022-06-23 12:20:47 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebRTC</component>
          <version>Safari 11</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Danilo">db</reporter>
          <assigned_to name="youenn fablet">youennf</assigned_to>
          <cc>mail-154060</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1415097</commentid>
    <comment_count>0</comment_count>
      <attachid>338098</attachid>
    <who name="Danilo">db</who>
    <bug_when>2018-04-17 04:42:14 -0700</bug_when>
    <thetext>Created attachment 338098
Demo

When creating a WebRTC DataChannel with in-band announcement (negotiated=false), the &quot;id&quot; attribute is not set on the side of the initiator.

Demo: https://tmp.dbrgn.ch/dc/

If you open this in Chromium or Firefox, the data channel id will be reported as an integer on both sides.

&gt; DC1 is open. id=1
&gt; DC2 is open. id=3
&gt; New data channel. id=1
&gt; New data channel. id=3

If you open it in Safari 11 or in the current technology preview, it will be reported as null on the initiator side.

&gt; DC1 is open. id=null
&gt; DC2 is open. id=null
&gt; New data channel. id=1
&gt; New data channel. id=3

The JS sourcecode can be found at https://tmp.dbrgn.ch/dc/dc.js.

From the spec (https://www.w3.org/TR/webrtc/#dom-rtcdatachannel-id):

&gt; The id attribute returns the ID for this RTCDataChannel . The value is initally null, which is what will be returned if the ID was not provided at channel creation time, and the DTLS role of the SCTP transport has not yet been negotiated. Otherwise, it will return the ID that was either selected by the script or generated by the user agent according to [ RTCWEB-DATA-PROTOCOL].

The current behavior seems to be a bug, and it breaks one of our data channel based applications in Safari.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1445451</commentid>
    <comment_count>1</comment_count>
    <who name="Lennart Grahl">mail-154060</who>
    <bug_when>2018-07-26 09:57:44 -0700</bug_when>
    <thetext>My upcoming WPT tests confirm this bug: https://github.com/web-platform-tests/wpt/pull/10468

FWIW, if I hadn&apos;t worked around this bug, pretty much all of the data channel tests would fail. So, I would appreciate if you fix it, so I can remove the workaround from the WPT test suite.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1877070</commentid>
    <comment_count>2</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2022-06-21 14:36:57 -0700</bug_when>
    <thetext>Nowadays http://wpt.live/webrtc/RTCDataChannel-id.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1877071</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-06-21 14:37:10 -0700</bug_when>
    <thetext>&lt;rdar://problem/95636476&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1877590</commentid>
    <comment_count>4</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-06-23 00:39:22 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/1718</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1877766</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-06-23 12:20:45 -0700</bug_when>
    <thetext>Committed 251795@main (4bb2fa75278d): &lt;https://commits.webkit.org/251795@main&gt;

Reviewed commits have been landed. Closing PR #1718 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>338098</attachid>
            <date>2018-04-17 04:42:14 -0700</date>
            <delta_ts>2018-04-17 04:42:14 -0700</delta_ts>
            <desc>Demo</desc>
            <filename>demo.tar.gz</filename>
            <type>application/gzip</type>
            <size>1853</size>
            <attacher name="Danilo">db</attacher>
            
              <data encoding="base64">H4sIAGjd1VoAA+1ZbW/bNhDO5/yKq/dBMubIlhInnWtnyJxky9aXNHa6DUMxyCIda5VJTaKSpoX/
+46kZVG2nHpFs2GYD0hi847PHe+OdyRDgubOY1ML6ajdln/do3bL/JvTjrvvHbb324ftAxx3UXx/
B9qPbhlSlgo/AdghPgsjvl7uU/z/KJGgSQLnj/QxdcgAHx4crIm/6x4dFvE/aB3uyKFWewdaj2lU
Tv/z+AecpQIGw+uXvw/Ort6cXUEPrFRkzBGThNKp7wQT69muFhteX5liIkvWi10P5kKav+czkvCQ
lIUuTwYDKcRev+D+Jbn+7nD/oP36+mf/l6sPp+xifMtvxXU0OD9/9V3rx3fDP+4S9tQ7/PXX24Nb
cfPum5+yp69Hk2t2jqi744wFIuQMEuqTe3vM6vBxF5DCMdiEB9mUMuH4QvjB5OwWP8O3sBhWcwbC
FxR6vR7UAj6NIypoDTqVQk+kUMR9ErKbWl3rkTRmdv2Z+jYDGqUUClZhAiFK//MwFZTRxLZOX73o
cybkGEJSYjUQKMfZnRlrS6nI4r4fRSM/eJfazJ/SBsRBvtQ4cDhj9IaL0JfyjFKEQw/btA69Y5Cu
5xF1CB1lN2o2fA1WByomWXP9CjKQo8qCVC4/mPjshm4CWz3RtpCPwAVXebWvuTi1XtIeBvSzDVg7
N7cBBfplM6oNwPwNCXJpkvBkVbMaNjRf9M9gM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