Repository navigation
Conversation
|
@cloudwebrtc , could you please review this PR ? |
cloudwebrtc
left a comment
There was a problem hiding this comment.
The FFI wiring looks correct: the field names and request oneof match track_publication.proto and the Rust handler. A few concerns about behavior around the new method, plus two test nits.
|
@cloudwebrtc @xianshijing-lk Thanks for the review! The Python-side feedback has been addressed, including subscription validation, the locally observable enabled state, documentation, improved unit tests, an audio RTP integration test, the changeset, and the latest EOS cleanup fix. The native findings are tracked upstream in livekit/rust-sdks#1720 and livekit/rust-sdks#1738 (with concurrent detach verification tracked in livekit/rust-sdks#1769). I've resolved the discussions as tracked upstream; these Rust fixes are not yet included in the pinned submodule, and native regression validation remains a prerequisite to merging. Could you please take another look at the Python changes and advise on the preferred integration order for the Rust dependencies? Thank you! |
cloudwebrtc
left a comment
There was a problem hiding this comment.
Thanks for the thorough follow-up. I went through the new commits and the Python side looks good to me:
- The subscription guard and the
RuntimeErrorbefore any FFI request work as expected, and the test covers that no request is sent. enabledas local requested state works well: it is reset ontrack_subscribed, it reads False when unsubscribed, and it is only updated after the request succeeds.- The EOS cleanup in 2fb5239 covers EOS,
disconnectedandCONN_DISCONNECTED, and the regression test exercises the missing-event case. - The tests now go through the real constructor, and the tautological assertion is gone.
Approving the Python changes. Please don't merge yet: the pinned Rust revision still has the native issues. The most important one is that a concurrent unpublish can panic and take down the whole Python process.
On the Rust dependencies, I'd suggest this order:
- Land rust-sdks#1720 (ordered/serialized settings updates) first, since #1738 overlaps with it.
- Rebase and land rust-sdks#1738 on top. It covers the quality/disabled merge and replaces the repeated lookup +
unwrap. - Confirm rust-sdks#1769 is covered by #1738's single-snapshot change, or close the remaining detach gap there.
- Cut a livekit-ffi release and bump the
rust-sdkssubmodule in this PR. - Run
test_audio_track_enable_disable.pyagainst a real server (it is skipped in CI without credentials) and post the result here.
Merge once the submodule bump is in and the e2e test passes.
Closes #976.
Motivation
Real-time voice and language-learning agents need to pause incoming microphone media between speaking attempts while keeping the subscription intact. Unsubscribing and resubscribing can require negotiation and stream recreation, risking loss of initial speech. Discarding frames in an agent input gate does not stop downstream media transfer. Publisher mute is a separate user-controlled operation.
Changes
EnableRemoteTrackPublicationRequestviaRemoteTrackPublication.set_enabled(enabled: bool).RuntimeError.publication.enabledas locally requested state, reset on a new subscription. This is not an SFU acknowledgment.Native dependencies (not yet fixed in this PR)
Review revealed existing Rust issues. A Python subscription guard does not eliminate the native race. Before merging, the pinned Rust submodule needs fixes for:
unwrap(); concurrent detach/settings synchronization still needs verification.Validation
The API does not remotely unmute the publisher or guarantee immediate media delivery. Repeated calls may not re-send the native setting when local state already matches.