fix(moq): fail connection on audio codec mismatch in pull node#461
Open
staging-devin-ai-integration[bot] wants to merge 1 commit into
Open
fix(moq): fail connection on audio codec mismatch in pull node#461staging-devin-ai-integration[bot] wants to merge 1 commit into
staging-devin-ai-integration[bot] wants to merge 1 commit into
Conversation
When catalog discovery during initialize() times out, the MoQ pull node keeps the constructor's default output pin codec. If run_connection() later discovers a different catalog audio codec, the node now returns an error instead of silently continuing with a mismatched pin type. This causes the reconnection loop to retry, giving catalog discovery another chance. Closes #454 Signed-off-by: Staging-Devin AI <166158716+staging-devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
When catalog discovery during
initialize()fails or times out, the MoQ pull node keeps the constructor's default output pin type (Opus). Ifrun_connection()later discovers a different catalog audio codec, it previously only logged a warning but continued sending packets with the mismatched codec — a pin contract violation.This PR makes
run_connection()returnErr(StreamKitError::Runtime(...))on codec mismatch, which causes the reconnection loop (line 197) to retry, giving catalog discovery another chance.Changes:
tracing::warn!in the mismatch block (~line 687), return an error to fail the connectiontest_codec_mismatch_detectabletest (which only assertedOpus != Aac) with four focused tests:test_default_node_has_opus_output_pin— default config produces Opus pintest_codec_mismatch_detected_between_pin_and_catalog— mismatch scenario (Opus pin vs AAC catalog)test_no_mismatch_when_pin_matches_catalog— matching codecs don't trigger failuretest_explicit_aac_config_avoids_mismatch_with_aac_catalog— explicit AAC config avoids mismatchCloses #454
Review & Testing Checklist for Human
run_connection()is clear and actionable in logsStreamKitError::Runtimeerrors (1s retry)Notes
This is the safer of the two options from the issue — failing the connection rather than updating pin types at runtime. Runtime pin updates can be done as a follow-up if needed.
Link to Devin session: https://staging.itsdev.in/sessions/8ccfbaefee4d496ab9e2b402efabf989
Requested by: @streamer45