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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>25836</bug_id>
          
          <creation_ts>2014-05-20 20:26:49 +0000</creation_ts>
          <short_desc>add note about addtrack being async</short_desc>
          <delta_ts>2014-12-15 10:39:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebRTC Working Group</product>
          <component>WebRTC API</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>LATER</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Cullen Jennings">fluffy</reporter>
          <assigned_to name="Web RTC Working Group">public-webrtc</assigned_to>
          <cc>adam.bergkvist</cc>
    
    <cc>harald</cc>
    
    <cc>juberti</cc>
    
    <cc>public-webrtc</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>106512</commentid>
    <comment_count>0</comment_count>
    <who name="Cullen Jennings">fluffy</who>
    <bug_when>2014-05-20 20:26:49 +0000</bug_when>
    <thetext>add notes that

Since addTrack is async, and getTracks is not, after you add one, there may be some time before it shows up in getTracks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106569</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2014-05-21 14:15:00 +0000</bug_when>
    <thetext>I suggest to keep addTrack() sync for simplicity.

The problem of which tracks that are included in what offer/answer can be solved by having createO/A() snapshot the list of currently added tracks at the point the method (creatO/A()) is called. According to Justin, that&apos;s how it works in Chrome today (but for streams).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114375</commentid>
    <comment_count>2</comment_count>
    <who name="Harald Alvestrand">harald</who>
    <bug_when>2014-10-31 17:55:35 +0000</bug_when>
    <thetext>The addtrack operation is synchronous, but it causes things to happen that are easier to describe as a queued task (stuff that happens in stable state).

Exemplar case:

createOffer().then(offer =&gt;)
AddTrack(track)

Will the offer include the added track or not?

There should be a test written for this behaviour, so that we know whether the behaviour is consistent or inconsistent between browsers.
It should be defined and deterministic, and the spec should say which is true.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114379</commentid>
    <comment_count>3</comment_count>
    <who name="Justin Uberti">juberti</who>
    <bug_when>2014-10-31 18:02:07 +0000</bug_when>
    <thetext>JSFiddle for addStream: http://jsfiddle.net/bvmkdsa4/2/ (needs some tweaking to work in non-webkit browsers)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114480</commentid>
    <comment_count>4</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2014-11-04 13:54:03 +0000</bug_when>
    <thetext>(In reply to Harald Alvestrand from comment #2)
&gt; The addtrack operation is synchronous, but it causes things to happen that
&gt; are easier to describe as a queued task (stuff that happens in stable state).
&gt; 
&gt; Exemplar case:
&gt; 
&gt; createOffer().then(offer =&gt;)
&gt; AddTrack(track)
&gt; 
&gt; Will the offer include the added track or not?

What do we want the answer to be?

With addTrack() async the answer is *no*. The task that adds the tracks is still on the operations queue when the createOffer task is picked up.

With addTrack(), with a return value, we can decide how we want it to be. If a snapshot of the added tracks is taken when createOffer() is picked up by the JS scheduler and stored for later processing in the queued operation, the answer is *no*. If we don&apos;t look at the added tracks until the createOffer task is picked up, then the track will be included and the answer is *yes*.

We need to document this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114483</commentid>
    <comment_count>5</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2014-11-04 14:00:37 +0000</bug_when>
    <thetext>this = our decision (not what I wrote)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116334</commentid>
    <comment_count>6</comment_count>
    <who name="Dominique Hazael-Massieux">dom</who>
    <bug_when>2014-12-15 10:39:44 +0000</bug_when>
    <thetext>WebRTC API bugs have been moved to github issues: https://github.com/w3c/webrtc-pc/issues

Please subscribe to the issues you want to keep watching.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>