[webrtc-pc] RTCPeerConnection-setLocalDescription-answer.html expects InvalidStateError on sLD(answer) when no answer has ever been created (#3129)

docfaraday has just created a new issue for https://github.com/w3c/webrtc-pc:

== RTCPeerConnection-setLocalDescription-answer.html expects InvalidStateError on sLD(answer) when no answer has ever been created ==
This is step 3 in setLocalDescription:

> If type is "[answer](https://w3c.github.io/webrtc-pc/#dom-rtcsdptype-answer)" or "[pranswer](https://w3c.github.io/webrtc-pc/#dom-rtcsdptype-pranswer)", and sdp is not the empty string and not equal to connection.[[[LastCreatedAnswer]]](https://w3c.github.io/webrtc-pc/#dfn-lastcreatedanswer), then return a promise [rejected](https://w3c.github.io/webrtc-pc/#dfn-reject) with a newly [created](https://webidl.spec.whatwg.org/#dfn-create-exception) [InvalidModificationError](https://webidl.spec.whatwg.org/#invalidmodificationerror) and abort these steps.

The only state check prior to this step is for rollback only (that's step 2). There is this language in the queued failure task steps for setting a description:

> If description.[type](https://w3c.github.io/webrtc-pc/#dom-rtcsessiondescriptioninit-type) is invalid for the current connection.[[[SignalingState]]](https://w3c.github.io/webrtc-pc/#dfn-signalingstate) as described in [[RFC9429](https://w3c.github.io/webrtc-pc/#bib-rfc9429)] ([section 5.5.](https://www.rfc-editor.org/rfc/rfc9429#section-5.5) and [section 5.6.](https://www.rfc-editor.org/rfc/rfc9429#section-5.6)), then [reject](https://w3c.github.io/webrtc-pc/#dfn-reject) p with a newly [created](https://webidl.spec.whatwg.org/#dfn-create-exception) [InvalidStateError](https://webidl.spec.whatwg.org/#invalidstateerror) and abort these steps.

It seems as though webrtc-pc expects the state checking to happen in the _in parallel_ steps specified in JSEP, which is how we can get to the queued failure task in the first place.

Which is right here, the test or the spec?

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/3129 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 21 July 2026 22:40:14 UTC