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" diff --git a/lib/src/participant/local.dart b/lib/src/participant/local.dart index d8149a465..470b57fe6 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, @@ -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,