W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > July 2017

Re: [webrtc-pc] setRemoteDescription and ontrack order of events: SRD before ontrack?

From: jan-ivar via GitHub <sysbot+gh@w3.org>
Date: Mon, 31 Jul 2017 18:26:57 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-319154872-1501525615-sysbot+gh@w3.org>
(Cc @docfaraday whom I gave opposite advice before going on vk!)

[The promise guide](https://www.w3.org/2001/tag/doc/promises-guide#resolve-promise]), says *"If the algorithm using ["Resolve p with x" or "Reject p with r"] is running in parallel, the shorthands queue a task on p’s relevant settings object’s responsible event loop to call the stored function."*.

Which, since these steps of [SRD](http://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-setremotedescription) are in parallel, means that:
```
1. Process remote tracks.
   1a. Queue a task to fire an event named track.
2. Resolve the promise.
```
...will in fact resolve the promise *after* the event is fired. @domenic is that right?

Probably a good thing since SRD conditionally will also "await the completion of identity validation." even though this is written in prose and contradicts the prose directly above it where we return a promise solely from the [set-description](http://w3c.github.io/webrtc-pc/#set-description) sub-step.

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/1508#issuecomment-319154872 using your GitHub account
Received on Monday, 31 July 2017 18:26:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:21:40 UTC