From 00770db51418b25c441126f11cc82be147a2512a Mon Sep 17 00:00:00 2001 From: Max Heimbrock <43608204+MaxHeimbrock@users.noreply.github.com> Date: Tue, 1 Dec 2026 13:46:28 +0100 Subject: [PATCH 1/3] Compile the SDK version in as a constant managed by verwalter The version reported to the server came from a text asset that an Editor script wrote into the consumer's Assets/Resources on every domain reload. That was "unknown" for copies of the SDK placed in Assets/ (no package context) and for the first Editor session of a project (the asset import is deferred past the reload in which FFI initializes), and it wrote a generated file into every consumer project. PackageVersion.Version is now a constant that verwalter updates with package.json on each release; verwalter warns if the two disagree. PackageVersionEmbedder is removed. Co-Authored-By: Claude Opus 5.5 --- .changeset/sdk-version-constant.md | 5 ++++ Editor/PackageVersionEmbedder.cs | 31 ---------------------- Editor/PackageVersionEmbedder.cs.meta | 11 -------- Runtime/Scripts/Internal/PackageVersion.cs | 11 +++----- verwalter.toml | 1 + 5 files changed, 10 insertions(+), 49 deletions(-) create mode 100644 .changeset/sdk-version-constant.md delete mode 100644 Editor/PackageVersionEmbedder.cs delete mode 100644 Editor/PackageVersionEmbedder.cs.meta diff --git a/.changeset/sdk-version-constant.md b/.changeset/sdk-version-constant.md new file mode 100644 index 00000000..85b14e18 --- /dev/null +++ b/.changeset/sdk-version-constant.md @@ -0,0 +1,5 @@ +--- +io.livekit.livekit-sdk: patch +--- + +The SDK version reported to the server is now compiled into the SDK, so it is no longer `"unknown"` when the SDK is copied into `Assets/` or in the first Editor session of a project. The SDK no longer writes `Assets/Resources/LiveKitSdkVersionInfo.txt` into your project; you can delete that file. diff --git a/Editor/PackageVersionEmbedder.cs b/Editor/PackageVersionEmbedder.cs deleted file mode 100644 index a18dd1ad..00000000 --- a/Editor/PackageVersionEmbedder.cs +++ /dev/null @@ -1,31 +0,0 @@ -#if UNITY_EDITOR -using UnityEditor; -using UnityEngine; - -[InitializeOnLoad] -public static class PackageVersionEmbedder -{ - const string PackageName = "io.livekit.livekit-sdk"; - const string ResourcePath = "Assets/Resources"; - const string AssetName = "LiveKitSdkVersionInfo"; - - [InitializeOnLoadMethod] - static void Embed() - { - // FindForAssetPath works with any asset inside the package - var info = UnityEditor.PackageManager.PackageInfo.FindForAssetPath($"Packages/{PackageName}"); - if (info == null) - { - Debug.Log($"Package {PackageName} not found"); - return; - } - - if (!System.IO.Directory.Exists(ResourcePath)) - System.IO.Directory.CreateDirectory(ResourcePath); - - string path = $"{ResourcePath}/{AssetName}.txt"; - System.IO.File.WriteAllText(path, info.version); - AssetDatabase.ImportAsset(path); - } -} -#endif \ No newline at end of file diff --git a/Editor/PackageVersionEmbedder.cs.meta b/Editor/PackageVersionEmbedder.cs.meta deleted file mode 100644 index 1524a23e..00000000 --- a/Editor/PackageVersionEmbedder.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 864f4c2dbee8547188d91281a691e628 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Runtime/Scripts/Internal/PackageVersion.cs b/Runtime/Scripts/Internal/PackageVersion.cs index 1ab2a91f..978cca34 100644 --- a/Runtime/Scripts/Internal/PackageVersion.cs +++ b/Runtime/Scripts/Internal/PackageVersion.cs @@ -1,13 +1,10 @@ -using UnityEngine; - namespace LiveKit.Internal { public static class PackageVersion { - public static string Get() - { - var asset = Resources.Load("LiveKitSdkVersionInfo"); - return asset != null ? asset.text.Trim() : "unknown"; - } + // Updated by verwalter on each release, together with package.json (see verwalter.toml). + public const string Version = "2.1.1"; + + public static string Get() => Version; } } diff --git a/verwalter.toml b/verwalter.toml index cb8298b6..98d1b4e0 100644 --- a/verwalter.toml +++ b/verwalter.toml @@ -5,4 +5,5 @@ path = "." versioning.files = [ "package.json", { path = "README.md", regex = '`#v(?\d[^`]*)`' }, + { path = "Runtime/Scripts/Internal/PackageVersion.cs", regex = 'const string Version = "(?[^"]+)"' }, ] From ed3f1e2c2ac588f28426c1cbce6c9532a2e5fb24 Mon Sep 17 00:00:00 2001 From: Max Heimbrock <43608204+MaxHeimbrock@users.noreply.github.com> Date: Tue, 1 Dec 2026 14:14:06 +0100 Subject: [PATCH 2/3] docs: list PackageVersion.Version among the versioned files in RELEASING.md Co-Authored-By: Claude Opus 5.5 --- RELEASING.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index 5681dfbd..c30d4635 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -14,8 +14,11 @@ This file holds what is specific to this repository. Users install the package from its git URL and tag. The tag is the whole release: there is no build job and no registry. -The version is in `package.json` and in the install instructions of -`README.md`. The release PR moves both. Never edit the version by hand. +The version is in `package.json`, in the install instructions of +`README.md`, and in `PackageVersion.Version` +(`Runtime/Scripts/Internal/PackageVersion.cs`), which is reported to the +server when a session connects. The release PR moves all three. Never edit +the version by hand. ## Workflows From 5be8d6a8bba53bcd83f099b75528d416b2f5dc6f Mon Sep 17 00:00:00 2001 From: Max Heimbrock <43608204+MaxHeimbrock@users.noreply.github.com> Date: Wed, 2 Dec 2026 12:42:57 +0100 Subject: [PATCH 3/3] chore: loosen the verwalter regex for PackageVersion.Version Match `string Version = "..."` with any whitespace around `=` and without requiring `const`, so a reformat or a switch to `static readonly` does not silently stop verwalter from bumping it. Co-Authored-By: Claude Opus 5.5 --- verwalter.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/verwalter.toml b/verwalter.toml index 98d1b4e0..d61fef53 100644 --- a/verwalter.toml +++ b/verwalter.toml @@ -5,5 +5,5 @@ path = "." versioning.files = [ "package.json", { path = "README.md", regex = '`#v(?\d[^`]*)`' }, - { path = "Runtime/Scripts/Internal/PackageVersion.cs", regex = 'const string Version = "(?[^"]+)"' }, + { path = "Runtime/Scripts/Internal/PackageVersion.cs", regex = 'string Version\s*=\s*"(?[^"]+)"' }, ]