From a270a610ad17c22c77ee69f72284e7ef9ad3991d Mon Sep 17 00:00:00 2001 From: pikann22 Date: Sun, 30 Aug 2026 16:40:56 +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. createScenario and updateScenario each declared their own `type body struct{...}` with the same name but different fields (string vs *string) -- TinyGo collapsed them into one shared field layout, so json.Unmarshal could decode against the wrong struct (differing field sizes here, not just differing field counts). Renamed both to createScenarioBody / updateScenarioBody. 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/scenarios.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/scenarios.go b/backend/scenarios.go index 24fb583..cb7bf0c 100644 --- a/backend/scenarios.go +++ b/backend/scenarios.go @@ -75,13 +75,13 @@ func (p *bddPlugin) createScenario(req *plugin.Request, res *plugin.Response) { return } - type body struct { + type createScenarioBody struct { Title string `json:"title"` Given string `json:"given"` When string `json:"when"` Then string `json:"then"` } - b, err := plugin.JSONBody[body](req) + b, err := plugin.JSONBody[createScenarioBody](req) if err != nil || b.Title == "" { res.Error(400, "title is required") return @@ -157,13 +157,13 @@ func (p *bddPlugin) updateScenario(req *plugin.Request, res *plugin.Response) { return } - type body struct { + type updateScenarioBody struct { Title *string `json:"title"` Given *string `json:"given"` When *string `json:"when"` Then *string `json:"then"` } - b, err := plugin.JSONBody[body](req) + b, err := plugin.JSONBody[updateScenarioBody](req) if err != nil { res.Error(400, "invalid request body") return From 7db500db8e83c37db4b504b591de7246035d9943 Mon Sep 17 00:00:00 2001 From: pikann22 Date: Sun, 30 Aug 2026 16:50:09 +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 99eb88c..b9d4294 100644 --- a/plugin.json +++ b/plugin.json @@ -2,7 +2,7 @@ "id": "com.paca.bdd", "displayName": "BDD Scenarios", "description": "Adds Given/When/Then BDD acceptance criteria to tasks.", - "version": "0.3.4", + "version": "0.3.5", "minCoreVersion": "v0.13.3", "permissions": ["db.read", "db.write", "events.subscribe"], "backend": {