From 5ec8acfd068c4aa30224dfcfafd58883edf9fc8f Mon Sep 17 00:00:00 2001 From: Tobias Ollmann Date: Tue, 28 Jul 2026 16:36:47 +0200 Subject: [PATCH 1/3] fix: don't set zero size if size is unknown it confuses other sdks (at least rust), e.g. [here](https://github.com/livekit/rust-sdks/blob/e37adc1dc4cb90322733fcb0fe1155262f309ff1/livekit-data-stream/src/incoming.rs#L325) --- lib/src/participant/local.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/participant/local.dart b/lib/src/participant/local.dart index d8149a465..10bc1d524 100644 --- a/lib/src/participant/local.dart +++ b/lib/src/participant/local.dart @@ -1062,7 +1062,7 @@ extension DataStreamParticipantMethods on LocalParticipant { mimeType: info.mimeType, topic: info.topic, timestamp: Int64(timestamp), - totalLength: Int64(options?.totalSize ?? 0), + totalLength: options?.totalSize != null ? Int64(options!.totalSize!) : null, attributes: options?.attributes.entries, textHeader: lk_models.DataStream_TextHeader( version: options?.version, From 9986f51776d136e3186cc3a27d1e8ea3685f829c Mon Sep 17 00:00:00 2001 From: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com> Date: Wed, 29 Jul 2026 02:32:34 +0900 Subject: [PATCH 2/3] fix: apply the same treatment to streamBytes --- lib/src/participant/local.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/participant/local.dart b/lib/src/participant/local.dart index 10bc1d524..470b57fe6 100644 --- a/lib/src/participant/local.dart +++ b/lib/src/participant/local.dart @@ -1150,7 +1150,7 @@ extension DataStreamParticipantMethods on LocalParticipant { ); final header = lk_models.DataStream_Header( - totalLength: Int64(info.size), + totalLength: options?.totalSize != null ? Int64(options!.totalSize!) : null, mimeType: info.mimeType, streamId: streamId, topic: options?.topic, From a530468c733acf214f17dd669766e24422e928ca Mon Sep 17 00:00:00 2001 From: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com> Date: Wed, 29 Jul 2026 02:32:34 +0900 Subject: [PATCH 3/3] chore: add changeset --- .changes/fix-data-stream-size | 1 + 1 file changed, 1 insertion(+) create mode 100644 .changes/fix-data-stream-size diff --git a/.changes/fix-data-stream-size b/.changes/fix-data-stream-size new file mode 100644 index 000000000..22dfe95d5 --- /dev/null +++ b/.changes/fix-data-stream-size @@ -0,0 +1 @@ +patch type="fixed" "Omit data stream totalLength when size is unknown"