Skip to content

fix: don't fire local_track_subscribed during reconnect#1099

Merged
ladvoc merged 2 commits into
mainfrom
dz/fix-reconnect-race
May 18, 2026
Merged

fix: don't fire local_track_subscribed during reconnect#1099
ladvoc merged 2 commits into
mainfrom
dz/fix-reconnect-race

Conversation

@davidzhao
Copy link
Copy Markdown
Member

During a full reconnect, the engine auto-resubscribes the republished local tracks under their new server-issued SIDs. Forwarding this event would race with the sid rekey driven by LocalTrackRepublished (different task, same dispatcher channel) and surface as a KeyError / already-resolved future on the binding side.

During a full reconnect, the engine auto-resubscribes the
republished local tracks under their new server-issued
SIDs. Forwarding this event would race with the sid
rekey driven by `LocalTrackRepublished` (different task,
same dispatcher channel) and surface as a KeyError /
already-resolved future on the binding side.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 17, 2026

Changeset

The following package versions will be affected by this PR:

Package Bump
livekit-ffi patch

@davidzhao davidzhao requested a review from ladvoc as a code owner May 17, 2026 17:55
Copy link
Copy Markdown
Contributor

@ladvoc ladvoc left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@ladvoc ladvoc merged commit a3f87e7 into main May 18, 2026
23 checks passed
@ladvoc ladvoc deleted the dz/fix-reconnect-race branch May 18, 2026 19:24
@knope-bot knope-bot Bot mentioned this pull request May 18, 2026
@theomonnom
Copy link
Copy Markdown
Member

For this fix, I'm wondering if it should be inside the rtc_engine vs inside the ffi?

ladvoc pushed a commit that referenced this pull request May 18, 2026
> [!IMPORTANT]
> Merging this pull request will create these releases

# livekit-datatrack 0.1.6 (2026-05-18)
## Fixes

- Add AGENTS.md and minor doc revisions
- Add `cargo-fuzz` target for packet deserialization
# webrtc-sys-build 0.3.17 (2026-05-18)
## Fixes

- fix libwebrtc cache permissions and optimize CI test workflows - #1071
(@davidzhao)
# livekit-api 0.4.23 (2026-05-18)
## Fixes

- Expose room playout delay options in the server API and let the local
video publisher recreate rooms with explicit min/max playout delay
settings.
# livekit-ffi 0.12.58 (2026-05-18)
## Features

- FFI logging improvements

### Make `sample_rate` and `num_channels` optional in
`NewAudioSourceRequest`.

These fields are ignored for `AudioSourcePlatform` (ADM uses hardware
native settings) and for `AudioSourceNative` fast path (queue_size_ms=0,
frame values used directly). Defaults to 48000 Hz and 1 channel when not
specified.

## Fixes

- fix: don't fire local_track_subscribed during reconnect - #1099
(@davidzhao)
- Fix LocalTrackPublished handle leak - #1065 (@MaxHeimbrock)
- Return EOS event from data track stream read request

Co-authored-by: knope-bot[bot] <152252888+knope-bot[bot]@users.noreply.github.com>
@davidzhao
Copy link
Copy Markdown
Member Author

For this fix, I'm wondering if it should be inside the rtc_engine vs inside the ffi?

what is this event used for by local clients? I know that FFI clients def don't need it.. because the handle is abstracted away locally.

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