Repository navigation
Conversation
One-shot sends through the FFI's send_text / send_bytes / send_file. The SDK core frames, chunks and compresses them, so they use data streams v2 (single-packet delivery and deflate compression) when every recipient supports it, like the other LiveKit SDKs. They block until the send completes, return the sent stream's info, and throw DataStreamError on failure. - StreamTextOptions / StreamByteOptions carry topic, attributes, destinations, stream id, reply-to and attachments (text), name, MIME type and total length (bytes), compress (default true) and sender_identity. - sendFile names the stream after the file's basename unless a name is given. The SDK core does not infer a MIME type from the file name, so the docs say it sends application/octet-stream unless one is set. - The FFI panics if a stream is sent after the room session is gone, so sends throw DataStreamError once the room has disconnected instead of reaching it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Text stream headers carry an operation type (create, update, delete, reaction), an optional message version and a generated flag; agents, for example, mark transcriptions as generated. The C++ SDK dropped them. - TextStreamOperationType, plus operation_type / version / generated on StreamTextOptions and TextStreamInfo. - Only non-default values are put on the wire, matching the other SDKs. - Tests: remote header fields surface on TextStreamInfo, sendText puts them on the wire, and the defaults are create, unversioned, not generated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ports the Rust outgoing-manager tests that sendText / sendBytes / sendFile can reproduce, checking the raw packets the receiving room gets: - Inline (single packet) vs multi-packet, and compressed vs not, for short, large-but-compressible, somewhat compressible and incompressible payloads, with and without compress. - Text with attachments never inlines; empty text is one inline packet. - sendFile never inlines, compresses when eligible, splits uncompressed files at the 15000-byte MTU, and handles empty and missing files. - Oversized attributes throw, and a broadcast to an empty room succeeds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 30, 2026
Author
|
CI for this branch (manually dispatched, since |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 3 of 5 of the data streams v2 stack. Merge in order; each part is mergeable on its own.
sendText/sendBytes/sendFile👈 this PRByteStreamReader::writeToFileand a receive size limitstreamText/streamBytesThis stack replaces #321, #322 and #325 (same code, reordered so each step stands on its own).
Adds one-shot sends, the Python-style API the other SDKs have:
API
LocalParticipant::sendText/sendBytes/sendFilego through the FFI'ssend_text/send_bytes/send_file.DataStreamErroron failure.StreamTextOptions/StreamByteOptionscarry:compress(defaulttrue) andsender_identity.total_lengthand the "incremental writers ignorecompress" notes apply tostreamText/streamBytes, which arrive in part 5.TextStreamOperationType, plusoperation_type/version/generatedonStreamTextOptionsandTextStreamInfo.generated; chat apps use the operation type for edits and reactions.DataStreamErroronce the room has disconnected instead of reaching it.TextStreamInfogains members, so code built against older headers must be recompiled.Nothing gets more broken: the v2 packets these send are what part 2 taught the C++ receive path to read.
Tests
test_data_stream_conformance_send.cppcompress = false, attachments, empty text,sendFilesplitting at the 15000-byte MTU, empty and missing files, oversized attributes, broadcast to an empty roomtest_data_stream_conformance_text_header.cpptest_data_streams.cpptest_data_stream.cpp(unit)Rust
outgoing/manager.rstests covered hereDataStreamSendConformanceTest.*)Not portable end to end:
Targeting,
sender_identityand the writer tests come in part 5.Follow-ups from the #325 review
sendFiledoesn't infer a MIME type from the file name. The Rust core sendsapplication/octet-stream. That should be fixed once in Rust'ssend_file, so every SDK gets it. For now the docs here say what is sent. Earlier report: Data streams v2 client-sdk-flutter#1166.disconnect()can still reach Rust after the room session is gone, and Rust panics. The C++ check narrows the window but can't close it. The fix is for the Rust data stream entry points to return a "not connected" error.Verification (local, macOS arm64,
livekit-server --dev)livekit1.3.0, both directions, 3/3 runs intact:send_text→ C++;sendText(short and 50 KB) andsendBytes(100 KB) → Python.DataTrackE2ETestschema tests (DefineAndGetSchema,DefineAndGetCustomSchemaEncoding,DefineDuplicateSchemaFails). They fail onmainon this machine too, and the 1 skip is the token-server test.🤖 Generated with Claude Code