diff --git a/.changeset/rtc-no-ffi-log-capture.md b/.changeset/rtc-no-ffi-log-capture.md new file mode 100644 index 00000000..e5a8b806 --- /dev/null +++ b/.changeset/rtc-no-ffi-log-capture.md @@ -0,0 +1,5 @@ +--- +'@livekit/rtc-node': patch +--- + +Stop capturing native logs: nothing consumed them, and every record down to trace level (including a libwebrtc dump of each data channel packet) was decoded and dispatched to every room. RUST_LOG now controls the native logs again. diff --git a/packages/livekit-rtc/src/ffi_client.test.ts b/packages/livekit-rtc/src/ffi_client.test.ts new file mode 100644 index 00000000..01e03b20 --- /dev/null +++ b/packages/livekit-rtc/src/ffi_client.test.ts @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: 2026 LiveKit, Inc. +// +// SPDX-License-Identifier: Apache-2.0 +import type * as Bindings from '@livekit/rtc-ffi-bindings'; +import { afterEach, describe, expect, it, vi } from 'vitest'; + +const { livekitInitialize } = vi.hoisted(() => ({ livekitInitialize: vi.fn() })); + +vi.mock('@livekit/rtc-ffi-bindings', async () => ({ + ...(await vi.importActual('@livekit/rtc-ffi-bindings')), + livekitInitialize, +})); + +describe('FfiClient', () => { + afterEach(() => { + globalThis._ffiClientInstance = undefined; + }); + + it('leaves native logs to the native logger instead of forwarding them as FFI events', async () => { + const { FfiClient } = await import('./ffi_client.js'); + + void FfiClient.instance; + + expect(livekitInitialize).toHaveBeenCalledWith(expect.any(Function), false, expect.any(String)); + }); +}); diff --git a/packages/livekit-rtc/src/ffi_client.ts b/packages/livekit-rtc/src/ffi_client.ts index f81ac8d8..143658dc 100644 --- a/packages/livekit-rtc/src/ffi_client.ts +++ b/packages/livekit-rtc/src/ffi_client.ts @@ -52,7 +52,9 @@ export class FfiClient extends (EventEmitter as new () => TypedEmitter