w3c / webrtc-encoded-transform

WebRTC Encoded Transform
https://w3c.github.io/webrtc-encoded-transform/
Other
123 stars 27 forks source link

Underspecified rid checking in sender.generateKeyFrame(["x"]); shouldn't throw NotAllowedError #192

Closed jan-ivar closed 1 year ago

jan-ivar commented 1 year ago

The spec says "If rid is defined, validate its value. If invalid, reject promise with NotAllowedError and abort these steps." E.g.

await sender.generateKeyFrame(["riddlemethis!"]); // throws NotAllowedError

Two problems:

  1. What does "invalid" mean?
    • A: not conforming "to the grammar requirements specified in Section 10 of [RFC8851]" (like in webrtc-pc)?
    • B: doesn't match any existing rid value in this sender's [[SendEncodings]]?
  2. "NotAllowedError" wrongly implies a user permission error.

My picks would be B and either TypeError or InvalidAccessError for consistency with webrtc-pc.

jan-ivar commented 1 year ago

Oh I see NotFoundError is used for valid rid that is not found. So 1.A is the answer.

In that case the 2 is the remaining issue (use an error other than NotAllowedError).

jan-ivar commented 1 year ago

(For 1. we should still clarify that by invalid we mean A in a PR)