Skip to content

DataTrackStreamReadResponse has optional DataTrackStreamEOS field#130

Merged
stephen-derosa merged 6 commits into
livekit:mainfrom
stephen-derosa:sderosa/bugfix/BOT-347-DT-sub-unpub-race
May 22, 2026
Merged

DataTrackStreamReadResponse has optional DataTrackStreamEOS field#130
stephen-derosa merged 6 commits into
livekit:mainfrom
stephen-derosa:sderosa/bugfix/BOT-347-DT-sub-unpub-race

Conversation

@stephen-derosa
Copy link
Copy Markdown
Collaborator

Overview

resolves BOT-347

fixes race condition of client SDK receiving eos events and initializing DT event listener by floating up an optional EOS message for a DataTrackStreamReadResponse

@ladvoc
Copy link
Copy Markdown
Contributor

ladvoc commented May 18, 2026

Rust PR has been merged: livekit/rust-sdks#1093

Copilot AI review requested due to automatic review settings May 19, 2026 16:20
Copy link
Copy Markdown

Copilot AI left a 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 addresses a race where a DataTrackStream can receive an EOS signal before the data-track event listener is fully ready by also propagating EOS via the immediate DataTrackStreamReadResponse.

Changes:

  • Add handling of optional EOS info returned directly in DataTrackStream::read() responses.
  • Factor EOS-to-terminal-error conversion into a helper used by both event-driven and read-response paths.
  • Add unit tests covering EOS delivered via DataTrackStreamReadResponse (both normal EOS and subscribe-failure EOS).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/data_track_stream.cpp Handles optional EOS embedded in the synchronous read response and refactors EOS error extraction.
include/livekit/data_track_stream.h Adds a forward declaration and private helper for read-response processing.
src/tests/unit/test_data_track_stream.cpp Adds unit tests validating EOS behavior via read responses.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/data_track_stream.cpp Outdated
@stephen-derosa stephen-derosa force-pushed the sderosa/bugfix/BOT-347-DT-sub-unpub-race branch 2 times, most recently from 485660c to 114cf3c Compare May 20, 2026 17:52
Comment thread src/data_track_stream.cpp
@stephen-derosa stephen-derosa force-pushed the sderosa/bugfix/BOT-347-DT-sub-unpub-race branch from 9ca29b4 to 6d521a7 Compare May 20, 2026 23:18
Comment thread include/livekit/data_track_stream.h
@stephen-derosa stephen-derosa merged commit f7a8df1 into livekit:main May 22, 2026
32 of 33 checks passed
@stephen-derosa stephen-derosa deleted the sderosa/bugfix/BOT-347-DT-sub-unpub-race branch May 22, 2026 16:44
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.

5 participants