fix(api): served-first fmtp verdict for _mainv and _subv (#593) - #613
Merged
Conversation
Two pre-existing gaps split out of #592: 1. _mainv keyed only on the SERVED SDP, so a record-from-sub camera's main (no persistent RTSP consumer) had a permanent None verdict and an fmtp-less HD main never got _mainv. 2. _subv stayed producer-only, so a sub with a present-but-incomplete a=fmtp (producer looks healthy, go2rtc serves a broken SDP) never got _subv. Unify both on a served-first, producer-fallback-POSITIVE-ONLY verdict (combine_fmtp_verdict): the served SDP wins when a consumer is attached; with no consumer, a producer that itself positively lacks fmtp still flags, but a healthy-looking Some(false) producer never un-flags (the #592 lie). The enabled-but-no-verdict observability log now fires on the combined None. Pure verdict helper is unit-tested across all served x producer combinations. Fixes #593 Signed-off-by: badbread <badbread@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #593. Two pre-existing gaps split out of #592.
1.
_mainvwas blind to a record-from-sub camera's main. Detection keyed only on the SERVED SDP, which needs a persistent RTSP consumer. A record-from-sub policy leaves the main with no consumer, so the served verdict was permanentlyNoneand an fmtp-less HD main never got_mainv.2.
_subvstayed producer-only. A sub whose producer advertises a present-but-incompletea=fmtplooks healthy on the producer side, but go2rtc serves consumers a broken SDP (the same class #592 found on the main). Producer-only detection missed it.Fix: unify both on
combine_fmtp_verdict(served, producer)= served-first, producer-fallback-positive-only. The served SDP (what the client actually receives) wins when a consumer is attached; with no consumer, a producer that itself positively lacks fmtp still flags, but a healthy-lookingSome(false)producer never un-flags, which is exactly the #592 lie.Noneonly when neither side knows, soresolve_needs_subv's sticky rule is preserved. The enabled-but-no-verdict observability log now fires on the combinedNone.No on-demand dial: per the issue, the positive-only fallback plus the existing debug signal covers the no-consumer case.
Test:
combine_verdict_is_served_first_producer_positive_onlycovers all served×producer combinations and both invariants.Gate green on dev2: fmt + clippy -D warnings +
cargo test --workspace.