Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

fix(plugins): stop rejecting plugins on manifest/register version mismatch

Gabe Kangas146f7c531ab8
diff --git a/services/plugins/manager_test.go b/services/plugins/manager_test.go
index 812017bf54..24f31b6725 100644
--- a/services/plugins/manager_test.go
+++ b/services/plugins/manager_test.go
@@ -16,8 +16,9 @@ import (
// name is what the manager keys discovered/enabled state by.
func makePluginFiles(t *testing.T, dir, name string, wasmBytes []byte) {
t.Helper()
- // Version must match what the bundled example's register() returns —
- // the host enforces manifest/runtime agreement at load time.
+ // Slug and permissions must agree with what the bundled example's
+ // register() returns — the host enforces manifest/runtime agreement on
+ // those at load time. Version is informational and not compared.
manifest := map[string]any{
"api": "1",
"name": name,
diff --git a/services/plugins/manifest.go b/services/plugins/manifest.go
index 61cc18007f..754e4c3c0a 100644
--- a/services/plugins/manifest.go
+++ b/services/plugins/manifest.go
@@ -671,9 +671,12 @@ func (m *Manifest) AgreesWith(other *Manifest) error {
if mySlug != otherSlug {
return fmt.Errorf("slug mismatch: manifest=%q register=%q", mySlug, otherSlug)
}
- if m.Version != other.Version {
- return fmt.Errorf("version mismatch: manifest=%q register=%q", m.Version, other.Version)
- }
+ // Version is intentionally not compared. It's informational metadata the
+ // host gates nothing on, and the SDK bakes it into register() output from
+ // the same manifest at build time, so a mismatch only ever indicates a
+ // stale build rather than an identity or security problem. Identity (slug)
+ // and security (permissions) are the checks that matter and are verified
+ // directly below.
declared := stringSet(m.Permissions)
for _, p := range other.Permissions {
if !declared[p] {
diff --git a/services/plugins/manifest_test.go b/services/plugins/manifest_test.go
index 9c3587c98f..ab708604a4 100644
--- a/services/plugins/manifest_test.go
+++ b/services/plugins/manifest_test.go
@@ -89,12 +89,14 @@ func TestAgreesWith_SlugMismatch(t *testing.T) {
}
}
-func TestAgreesWith_VersionMismatch(t *testing.T) {
+func TestAgreesWith_VersionDifferenceTolerated(t *testing.T) {
+ // Version is informational metadata, not an identity or security check, so
+ // a difference between the sidecar and register() output is not a fatal
+ // mismatch. Only slug and permissions are enforced.
sidecar := &Manifest{API: "1", DisplayName: "demo", Version: "1.0.0"}
runtime := &Manifest{API: "1", DisplayName: "demo", Version: "2.0.0"}
- err := sidecar.AgreesWith(runtime)
- if err == nil || !strings.Contains(err.Error(), "version mismatch") {
- t.Errorf("expected version mismatch error, got: %v", err)
+ if err := sidecar.AgreesWith(runtime); err != nil {
+ t.Errorf("version difference should be tolerated, got error: %v", err)
}
}