Skip to content

allow for audio filters to be registered after initial room connection - #1273

Merged
lukasIO merged 6 commits into
mainfrom
lukas/filter-load-late-import
Jul 29, 2026
Merged

allow for audio filters to be registered after initial room connection#1273
lukasIO merged 6 commits into
mainfrom
lukas/filter-load-late-import

Conversation

@lukasIO

@lukasIO lukasIO commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Problem

Audio-filter plugins are authenticated in a one-time pass: when a room
connects, FfiRoom::connect calls on_load(url, token) for every plugin
registered at that moment. A plugin registered after the room has
connected is never initialized for it — its later create then fails
because the connection was never authenticated (surfacing downstream as
"failed to initialize the audio filter").

Because room.connect() is async, any registration that lands in that
window loses the race.

Fix

When a plugin is registered (LoadAudioFilterPlugin), also run its on_load
against every already-connected room, using each room's connect URL and
current token — so registration order no longer matters.

  • New Room::token() accessor (livekit): current signalling token, needed to
    authenticate late-registered plugins.
  • New FfiServer::list_rooms() (livekit-ffi): snapshot of connected rooms
    (refactored out of the existing dispose logic).
  • on_load_audio_filter_plugin runs on_load per room on spawn_blocking
    (fire-and-forget), so a plugin whose on_load does network I/O can't stall
    the request thread. on_load is idempotent per URL, so this can't conflict
    with the connect-time pass. Registration happens before the loop so a
    concurrently-connecting room is still covered by the normal path.

Notes

  • Uses the room's connect URL (not the resolved signalling URL) so the auth
    key matches what create later looks up.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Changeset ✓

This PR includes a changeset covering all affected packages:

Package Bump
livekit patch
livekit-ffi patch

devin-ai-integration[bot]

This comment was marked as resolved.

@xianshijing-lk xianshijing-lk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm if you add the test.

Comment thread livekit-ffi/src/server/requests.rs
Comment thread livekit-ffi/src/server/requests.rs
Comment thread livekit-ffi/src/server/requests.rs
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@lukasIO
lukasIO requested a review from 1egoman July 27, 2026 14:51
@lukasIO
lukasIO merged commit 865cd0f into main Jul 29, 2026
24 checks passed
@lukasIO
lukasIO deleted the lukas/filter-load-late-import branch July 29, 2026 12:16
@knope-bot knope-bot Bot mentioned this pull request Jul 29, 2026
1egoman pushed a commit that referenced this pull request Jul 29, 2026
> [!IMPORTANT]
> Merging this pull request will create these releases

# livekit-protocol 0.7.12 (2026-07-29)
## Fixes

- Add data streams v2 - #1192 (@1egoman)
# livekit 0.8.1 (2026-07-29)
## Fixes

- allow for audio filters to be registered after initial room connection
- #1273 (@lukasIO)
- Caching of tokio backend reqwest http client - #1285 (@MaxHeimbrock)
- Add data streams v2 - #1192 (@1egoman)
- Ensure participant disconnects are synthesized after connection resume
- #1250 (@lukasIO)
# livekit-api 0.6.1 (2026-07-29)
## Fixes

- Caching of tokio backend reqwest http client - #1285 (@MaxHeimbrock)
- Add data streams v2 - #1192 (@1egoman)
# livekit-net 0.1.2 (2026-07-29)
## Fixes

- Caching of tokio backend reqwest http client - #1285 (@MaxHeimbrock)
# livekit-data-stream 0.1.1 (2026-07-29)
## Features

- Add data streams v2 - #1192 (@1egoman)
# livekit-uniffi 0.1.7 (2026-07-29)
## Fixes

- Caching of tokio backend reqwest http client - #1285 (@MaxHeimbrock)
- Add data streams v2 - #1192 (@1egoman)
# livekit-ffi 0.12.73 (2026-07-29)
## Fixes

- allow for audio filters to be registered after initial room connection
- #1273 (@lukasIO)
- Caching of tokio backend reqwest http client - #1285 (@MaxHeimbrock)
- Add data streams v2 - #1192 (@1egoman)
- Ensure participant disconnects are synthesized after connection resume
- #1250 (@lukasIO)
# livekit-datatrack 0.1.13 (2026-07-29)
## Fixes

- Add data streams v2 - #1192 (@1egoman)

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>
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.

3 participants