W3C home > Mailing lists > Public > public-ortc@w3.org > April 2016

[ortc] Promises resolution not defined

From: Sergio Garcia Murillo via GitHub <sysbot+gh@w3.org>
Date: Mon, 11 Apr 2016 11:10:12 +0000
To: public-ortc@w3.org
Message-ID: <issues.opened-147394329-1460373010-sysbot+gh@w3.org>
murillo128 has just created a new issue for 
https://github.com/openpeer/ortc:

== Promises resolution not defined ==
Several methods of the ORTC objects return a promise, but it is not 
defined when they are resolved nor what value is it resolved to.

For example: 

```
setTrack
Attempts to replace the track being sent with another track provided.

When the setTrack() method is invoked, the user agent must run the 
following steps:

1. Let p be a new promise.

2. Let withTrack be the argument to this method.

3. Run the following steps asynchronously:

    1. If withTrack.kind differs from RTCRtpSender.track.kind or if 
withTrack has different peerIdentity constraints, then reject p with 
IncompatibleMediaStreamTrackError and abort these steps.
    2. If withTrack.readyState is "ended" then reject p with 
IncompatibleMediaStreamTrackError and abort these steps.
    3. Set the RTCRtpSender.track attribute to withTrack, and have the
 sender seamlessly switch to transmitting withTrack in place of what 
it is sending. On the remote receiving end, the track maintains its 
existing grouping and id until the connection ends.
```

It is assumed that the the promise will be resolved on async-3 step 
with an `undefined` (?) value, but this should be explicitly said, as 
for example:

```
3. Run the following steps asynchronously:

    1. If withTrack.kind differs from RTCRtpSender.track.kind or if 
withTrack has different peerIdentity constraints, then reject p with 
IncompatibleMediaStreamTrackError and abort these steps.
    2. If withTrack.readyState is "ended" then reject p with 
IncompatibleMediaStreamTrackError and abort these steps.
    3. Set the RTCRtpSender.track attribute to withTrack, and have the
 sender seamlessly switch to transmitting withTrack in place of what 
it is sending. On the remote receiving end, the track maintains its 
existing grouping and id until the connection ends.
    4. Resolve p with withTrack value
```

Please view or discuss this issue at 
https://github.com/openpeer/ortc/issues/463 using your GitHub account
Received on Monday, 11 April 2016 11:10:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:39:59 UTC