Repository navigation
Conversation
The FFI requires the track sid to find a cryptor, and panics (aborting the process) when it's missing. FrameCryptor now keeps the sid that frameCryptors() receives, sends it, and exposes it as trackSid(). Fixes livekit#311 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The changes break constructor source and binary compatibility and alter an exported type’s layout, risking invalid memory access for existing consumers.
2 open issues
What changed in this PR
Addresses #311’s FrameCryptor setter crashes by passing the track SID through the LiveKit C++ SDK to the Rust bridge.
Changes:
- Retains each cryptor’s track SID and sends it with
setKeyIndex()andsetEnabled(). - Adds a
trackSid()accessor and a required constructor parameter. - Extends unit coverage and adds an integration test that verifies setter results.
| File | Description |
|---|---|
src/tests/unit/test_e2ee.cpp |
Checks the new track SID accessor. |
src/tests/integration/test_e2ee.cpp |
Verifies key-index and enablement changes for a published track. |
src/e2ee.cpp |
Stores track SIDs from cryptor enumeration and includes them in setter requests. |
include/livekit/e2ee.h |
Updates the public constructor, accessor, stored state, and track-specific documentation. |
Review effort: Balanced
… instead Adding the track sid to FrameCryptor changed its constructor and its layout, which existing binaries rely on (its destructor and moves are inline). Instead, its setters now look up the participant's tracks and apply to each, as their documentation already describes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The |


Fixes #311
What changed
E2EEManager::FrameCryptor::setKeyIndex()andsetEnabled()now send a track sid. Without one, the FFI panicked converting the empty sid (requests.rs:760), which aborted the process.FrameCryptoronly knows its participant, and adding the track would change its constructor and layout. So, as their docs already describe ("for this participant"), the setters look up the participant's cryptors withmanager_get_frame_cryptorsand apply to each of its tracks. The public API and ABI are unchanged.frameCryptors()reports both tracks switched to key index 1 and disabled.Testing
Ran on Linux x86_64 against
livekit-server --dev:setKeyIndex()call aborts the test binary with the panic above.🤖 Generated with Claude Code