Bug 1518672 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Specifically, signalingstatechange fires before currentDirection is set when going to "stable", diminishing its usefulness for tracking negotiation results.

STRs:
 1. Open https://jsfiddle.net/jib1/2s0yonrf/ and share camera (twice).
 2. Check the first Hold button only.

Expected result:
```
.----
|          Hold ☑
|sendonly
|sendonly
`----
           Hold ☐
recvonly
recvonly
```

Actual result:
```
.----
|          Hold ☑
|sendrecv
|sendonly
`----
           Hold ☐
sendrecv
recvonly
```


The relevant code emitting these being:
```js
pc.onsignalingstatechange = async () => {
  update(pc.getTransceivers()[0].currentDirection);
  await wait(200);
  update2(pc.getTransceivers()[0].currentDirection);
}
```

The spec [1] says to fire this event in step 10, basically after all state has been updated (steps 10-16 solely fire events and resolve the call, whereas currentDirection is set in steps 7 or 8).

Not a regression AFAICT.

[1] http://w3c.github.io/webrtc-pc/#set-description
Specifically, signalingstatechange fires before currentDirection is set when going to "stable", diminishing its usefulness for tracking negotiation results.

STRs:
 1. Open https://jsfiddle.net/jib1/2s0yonrf/ and share camera (twice).
 2. Check the first Hold button only.

Expected result:
```
.----
|          Hold ☑
|sendonly
|sendonly
`----
           Hold ☐
recvonly
recvonly
```

Actual result:
```
.----
|          Hold ☑
|sendrecv
|sendonly
`----
           Hold ☐
sendrecv
recvonly
```


The relevant code emitting these being:
```javascript
pc.onsignalingstatechange = async () => {
  update(pc.getTransceivers()[0].currentDirection);
  await wait(200);
  update2(pc.getTransceivers()[0].currentDirection);
}
```

The spec [1] says to fire this event in step 10, basically after all state has been updated (steps 10-16 solely fire events and resolve the call, whereas currentDirection is set in steps 7 or 8).

Not a regression AFAICT.

[1] http://w3c.github.io/webrtc-pc/#set-description
Specifically, signalingstatechange fires before currentDirection is set when going to "stable", diminishing its usefulness for tracking negotiation results.

STRs:
 1. Open https://jsfiddle.net/jib1/2s0yonrf/ and share camera (twice).
 2. Check the first Hold button only.

Expected result:
```
.----
|          Hold ☑
|sendonly
|sendonly
`----
           Hold ☐
recvonly
recvonly
```

Actual result:
```
.----
|          Hold ☑
|sendrecv
|sendonly
`----
           Hold ☐
sendrecv
recvonly
```


The relevant code emitting these being:
```js
pc.onsignalingstatechange = async () => {
  update(pc.getTransceivers()[0].currentDirection);
  await wait(200);
  update2(pc.getTransceivers()[0].currentDirection);
}
```

The spec [1] says to fire this event in step 10, basically after all state has been updated (steps 10-16 solely fire events and resolve the call, whereas currentDirection is set in steps 7 or 8).

Not a regression AFAICT.

[1] http://w3c.github.io/webrtc-pc/#set-description

Back to Bug 1518672 Comment 0