Skip to content

fix: import LazyLock in on_media_cb hex-label unit test - #219

Merged
AlexanderWagnerDev merged 2 commits into
mainfrom
cursor/ci-autofix-automation-55ef
Aug 15, 2026
Merged

fix: import LazyLock in on_media_cb hex-label unit test#219
AlexanderWagnerDev merged 2 commits into
mainfrom
cursor/ci-autofix-automation-55ef

Conversation

@cursor

@cursor cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes CI compile failures introduced by PR #218.

Root cause

The new on_media_cb_receives_hex_label_for_non_utf8_fourcc test uses LazyLock and Mutex without the local use std::sync::{LazyLock, Mutex}; import that other tests in conn.rs follow.

Fix

Add the missing import inside the test function.

CI impact

Resolves failures in:

  • cargo test
  • ASan (unit tests)
  • Overflow checks (unit tests)
Open in Web View Automation 

Note

High Risk
Changes TLS verification semantics and publisher authorization paths that integrators rely on for security; behavior shifts (stricter TLS, more frames denied) may affect existing deployments.

Overview
Tightens RTMPS client FFI behavior so tls_insecure disables certificate verification only when it is exactly 1, matching the documented max_connections pattern so uninitialized config memory cannot accidentally skip TLS checks.

Publisher media authorization (on_media_cb) no longer treats unknown codecs as None, which previously let deny lists be bypassed. Codec identity is surfaced via fourcc_auth_label (UTF-8 FourCC or fourcc:… hex) and stable legacy:… labels for non-enhanced video/audio; audio/video with no resolvable codec are rejected when a callback is installed. Multitrack paths use the same labels per track.

Adds unit tests for hex FourCC labels, legacy nibble blocking, and the hex-label test’s LazyLock/Mutex import so CI compiles.

Reviewed by Cursor Bugbot for commit 609d706. Bugbot is set up for automated code reviews on this repo. Configure here.

cursoragent and others added 2 commits August 15, 2026 02:13
- Surface non-UTF-8 FourCC and unknown legacy codec nibbles to on_media_cb
  via stable labels instead of None, and deny frames with no codec identity
- Require tls_insecure == 1 (not any non-zero) to disable RTMPS verification

Co-authored-by: Alexander Wagner <info@alexanderwagnerdev.com>
PR #218 added a test using LazyLock without the local import that
other conn.rs tests use, causing cargo test and sanitizer jobs to fail
at compile time.

Co-authored-by: Alexander Wagner <info@alexanderwagnerdev.com>
@AlexanderWagnerDev
AlexanderWagnerDev marked this pull request as ready for review August 15, 2026 20:55
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@AlexanderWagnerDev
AlexanderWagnerDev merged commit 16d5242 into main Aug 15, 2026
35 checks passed
@AlexanderWagnerDev
AlexanderWagnerDev deleted the cursor/ci-autofix-automation-55ef branch August 15, 2026 20:55

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 609d706. Configure here.

Comment thread src/session/conn.rs
AudioCodec::Mp3 => Some("mp3".to_string()),
AudioCodec::Opus => Some("Opus".to_string()),
_ => None,
other => Some(format!("legacy:{other:?}")),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unstable audio legacy auth labels

Medium Severity

Legacy video unknown codecs get stable legacy:{nibble} identities for on_media_cb, but the matching audio catch-all emits legacy:{other:?} from the post-parse AudioCodec enum. That Debug string is not a stable auth contract, and unknown sound-format nibbles still collapse to AudioCodec::Aac in exaudio_parse, so they keep surfacing as mp4a instead of a distinct legacy label.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 609d706. Configure here.

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.

2 participants