From 6b054d335ad1dd007e765221526f24f9a7e918eb Mon Sep 17 00:00:00 2001 From: pikann22 Date: Sun, 30 Aug 2026 16:43:04 +0000 Subject: [PATCH 1/2] fix: give locally-scoped JSONBody[T] body types unique names TinyGo's generic-function monomorphization keys plugin.JSONBody[T] instantiations by T's bare type name rather than its full declaration site. createHello and updateHello each declared their own `type body struct{...}` with the same name but different fields -- TinyGo could collapse them into one shared field layout, so json.Unmarshal would silently decode one call site against the wrong struct. Renamed both to createHelloBody / updateHelloBody. Part of a coordinated fix across all first-party plugins; see Paca-AI/paca#445 and Paca-AI/paca-plugin-github#24 for the full root-cause writeup and verification. --- backend/plugin.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/plugin.go b/backend/plugin.go index 764a552..d7a0c85 100644 --- a/backend/plugin.go +++ b/backend/plugin.go @@ -89,12 +89,12 @@ func (p *examplePlugin) listHello(req *plugin.Request, res *plugin.Response) { } func (p *examplePlugin) createHello(req *plugin.Request, res *plugin.Response) { - type body struct { + type createHelloBody struct { Name string `json:"name"` TaskID string `json:"task_id"` } - payload, err := plugin.JSONBody[body](req) + payload, err := plugin.JSONBody[createHelloBody](req) if err != nil { res.Error(400, "invalid JSON body") return @@ -165,11 +165,11 @@ func (p *examplePlugin) updateHello(req *plugin.Request, res *plugin.Response) { return } - type body struct { + type updateHelloBody struct { Name string `json:"name"` } - payload, err := plugin.JSONBody[body](req) + payload, err := plugin.JSONBody[updateHelloBody](req) if err != nil { res.Error(400, "invalid JSON body") return From 5c7cc3686f66815d9e10e1517eab2327870da770 Mon Sep 17 00:00:00 2001 From: pikann22 Date: Sun, 30 Aug 2026 16:50:33 +0000 Subject: [PATCH 2/2] chore: bump patch version in plugin.json --- plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.json b/plugin.json index 3e69d0f..5183897 100644 --- a/plugin.json +++ b/plugin.json @@ -2,7 +2,7 @@ "id": "com.paca.example", "displayName": "Plugin SDK Hello World", "description": "Hello world examples for every Paca plugin SDK feature.", - "version": "0.1.1", + "version": "0.1.2", "minCoreVersion": "v0.13.3", "permissions": ["db.read", "db.write", "events.subscribe", "events.emit"], "backend": {