From 5dcad204387065101320d56b625fd489c00cfc53 Mon Sep 17 00:00:00 2001 From: pikann22 Date: Sun, 30 Aug 2026 16:41:53 +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. createChecklist/updateChecklist and createItem/updateItem each declared their own `type body struct{...}` -- same name reused four times in the package, with three distinct field shapes among them. TinyGo could collapse these into one shared field layout, so json.Unmarshal would silently decode some call sites against the wrong struct. Renamed all four to createChecklistBody / updateChecklistBody / createItemBody / updateItemBody so every JSONBody[T] argument is unique within the package -- including the two that happened to share an identical shape already, since that safety was coincidental and fragile to a future edit. 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/checklists.go | 8 ++++---- backend/items.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/checklists.go b/backend/checklists.go index f0e94aa..98a2ef6 100644 --- a/backend/checklists.go +++ b/backend/checklists.go @@ -126,10 +126,10 @@ func (p *checklistPlugin) createChecklist(req *plugin.Request, res *plugin.Respo return } - type body struct { + type createChecklistBody struct { Title string `json:"title"` } - b, err := plugin.JSONBody[body](req) + b, err := plugin.JSONBody[createChecklistBody](req) if err != nil || b.Title == "" { res.Error(400, "title is required") return @@ -189,10 +189,10 @@ func (p *checklistPlugin) updateChecklist(req *plugin.Request, res *plugin.Respo return } - type body struct { + type updateChecklistBody struct { Title *string `json:"title"` } - b, err := plugin.JSONBody[body](req) + b, err := plugin.JSONBody[updateChecklistBody](req) if err != nil { res.Error(400, "invalid request body") return diff --git a/backend/items.go b/backend/items.go index ceee1cb..bbe70ec 100644 --- a/backend/items.go +++ b/backend/items.go @@ -50,10 +50,10 @@ func (p *checklistPlugin) createItem(req *plugin.Request, res *plugin.Response) return } - type body struct { + type createItemBody struct { Title string `json:"title"` } - b, err := plugin.JSONBody[body](req) + b, err := plugin.JSONBody[createItemBody](req) if err != nil || b.Title == "" { res.Error(400, "title is required") return @@ -117,12 +117,12 @@ func (p *checklistPlugin) updateItem(req *plugin.Request, res *plugin.Response) return } - type body struct { + type updateItemBody struct { Title *string `json:"title"` IsChecked *bool `json:"is_checked"` AssigneeID optionalString `json:"assignee_id"` } - b, err := plugin.JSONBody[body](req) + b, err := plugin.JSONBody[updateItemBody](req) if err != nil { res.Error(400, "invalid request body") return From 3e3fecef372baf8fe4a1ee6e85d655133ddf5dea Mon Sep 17 00:00:00 2001 From: pikann22 Date: Sun, 30 Aug 2026 16:50:16 +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 8460b05..06391b0 100644 --- a/plugin.json +++ b/plugin.json @@ -2,7 +2,7 @@ "id": "com.paca.checklist", "displayName": "Checklist", "description": "Adds named checklists with checkable items to tasks.", - "version": "0.2.10", + "version": "0.2.11", "minCoreVersion": "v0.13.3", "permissions": ["db.read", "db.write", "events.subscribe"], "backend": {