Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "required" specifiers within dictionaries #569

Merged
merged 2 commits into from
Apr 23, 2020
Merged

Conversation

alvestrand
Copy link
Contributor

Fixes #304

Copy link
Collaborator

@henbos henbos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am happy with all the required metrics in this PR becoming required, and as such feel free to merge the PR, but per comment below I think it would make sense to expand required to include any metrics where, if implemented, the value "undefined" has no meaning.

@@ -750,7 +750,7 @@ <h3>
</h3>
<div>
<pre class="idl">dictionary RTCRtpStreamStats : RTCStats {
unsigned long ssrc;
required unsigned long ssrc;
DOMString kind;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is kind not required? It's not valid to have a stream that has an undefined kind. (Even if you null the track, the sender can't change kind, it just silences it)

Copy link
Contributor Author

@alvestrand alvestrand Apr 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I was considering whether or not we needed an affordance for kinds that weren't supported yet, but I think that would not be an RTP stream. Let's make the kind required.
(Adding a new kind is a huge undertaking in our current document structure anyway.)

unsigned long contributorSsrc;
DOMString inboundRtpStreamId;
required unsigned long contributorSsrc;
required DOMString inboundRtpStreamId;
unsigned long packetsContributedTo;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's an example of a counter that might not be very important, but it always has a defined value if implemented (unlike framesDecoded which is only valid for video and thus has a sensible definition of undefined: the audio stream case).

Opinion: if the only meaning of "undefined" for a metric is "it hasn't been implemented" then I think is should be required, otherwise it is like saying "you can implemented this as undefined by not implementing it"... that sounds self-contradictory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a reasonable argument. However, it applies to all counters.
The counterargument is for the case where an implementor sees value in knowing what ssrcs exist as CSRCs, but doesn't care about the packet value (or finds it too hard to implement correctly) - that implementation is either conformant or non-conformant to this spec; if we make the counter mandatory, it's non-conformant even in the absence of a conformance statement anywhere else.

I think I'm arguing myself into leaving it non-required.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Am I correct in thinking that this implies that required means "the subset of mandatory to implement stats that can't be undefined if implemented"?

@alvestrand alvestrand merged commit 096961f into master Apr 23, 2020
@vr000m vr000m deleted the required-fields-304 branch June 12, 2021 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stats need to mark up which members are required
2 participants