-
Notifications
You must be signed in to change notification settings - Fork 111
Conversation
...nd modify setKey method
⚠️ No Changeset found
Latest commit: d448aa8
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
CLAassistant
commented
Mar 31, 2026
CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Devin Review: No Issues Found
Devin Review analyzed this PR and found no potential bugs to report.
View in Devin Review to see 3 additional findings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the Node RTC SDK’s E2EE integration to match newer @livekit/rtc-ffi-bindings APIs, including per-track cryptor identification (trackSid) and updated key-setting behavior.
Changes:
- Bump
@livekit/rtc-ffi-bindingsfrom0.12.46-dev.8to0.12.52(and update the lockfile accordingly). - Update
FrameCryptorto carrytrackSidand include it in relevant FFI requests. - Change
KeyProvider.setKeyto require the raw key bytes, and add convenience wrappers onE2EEManager.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
pnpm-lock.yaml |
Locks the repo to @livekit/rtc-ffi-bindings@0.12.52 (all platform packages updated). |
packages/livekit-rtc/src/e2ee.ts |
Updates E2EE request shapes (adds trackSid, changes setKey signature, adds manager wrappers). |
packages/livekit-rtc/package.json |
Pins @livekit/rtc-ffi-bindings dependency to 0.12.52. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
packages/livekit-rtc/src/e2ee.ts:41
DEFAULT_RATCHET_WINDOW_SIZEis changed, butKeyProviderOptions(includingratchetWindowSize,ratchetSalt, andfailureTolerance) is currently only stored onKeyProviderand never used to configure the underlying FFI. If the intent is to change ratchet behavior, this file should pass these options into an initialization/config request; otherwise the default values here are effectively dead configuration and can be misleading.
const DEFAULT_RATCHET_SALT = new TextEncoder().encode('LKFrameEncryptionKey');
const DEFAULT_RATCHET_WINDOW_SIZE = 10;
const DEFAULT_FAILURE_TOLERANCE = -1;
export interface KeyProviderOptions {
sharedKey?: Uint8Array;
ratchetSalt?: Uint8Array;
ratchetWindowSize?: number;
failureTolerance?: number;
}
export const defaultKeyProviderOptions: KeyProviderOptions = {
ratchetSalt: DEFAULT_RATCHET_SALT,
ratchetWindowSize: DEFAULT_RATCHET_WINDOW_SIZE,
failureTolerance: DEFAULT_FAILURE_TOLERANCE,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot
AI
Apr 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KeyProvider.setKey is a breaking change for consumers (this class is exported from src/index.ts), since it now requires a Uint8Array key parameter and changes the method signature/semantics. Consider providing an overload/backwards-compatible alternative (or a new method name) and/or documenting the migration path so downstream users don’t unexpectedly break on upgrade.
Copilot
AI
Apr 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There’s no test coverage around the new/changed E2EE request payloads (notably trackSid being included in cryptorSetEnabled/cryptorSetKeyIndex). Since this package already uses Vitest for unit tests, consider adding a small unit test that stubs globalThis._ffiClientInstance and asserts the constructed E2eeRequest includes trackSid (and the expected values) to prevent regressions.
Copilot
AI
Apr 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR changes exported public APIs in e2ee.ts (e.g., KeyProvider.setKey signature) but packages/livekit-rtc’s package version isn’t updated here. If this package follows semver, consider bumping the version (and/or adding release notes) to reflect the breaking API change for downstream users.
Update KeyProvider and FrameCryptor to include trackSid and modify setKey method