From 0ebf58fe5293a2fe4579a0bcb1187d1d21e03a97 Mon Sep 17 00:00:00 2001 From: pikann22 Date: Sun, 30 Aug 2026 16:44:16 +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. createWebhook and updateWebhook 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 createWebhookBody / updateWebhookBody. 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/webhooks.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/webhooks.go b/backend/webhooks.go index a4c12c0..0982125 100644 --- a/backend/webhooks.go +++ b/backend/webhooks.go @@ -184,12 +184,12 @@ func (p *webhookPlugin) listWebhooks(req *plugin.Request, res *plugin.Response) func (p *webhookPlugin) createWebhook(req *plugin.Request, res *plugin.Response) { projectID := req.PathParam("projectId") - type body struct { + type createWebhookBody struct { URL string `json:"url"` Secret string `json:"secret"` Events []string `json:"events"` } - b, err := plugin.JSONBody[body](req) + b, err := plugin.JSONBody[createWebhookBody](req) if err != nil { apiError(res, 400, "BAD_REQUEST", "invalid request body") return @@ -262,13 +262,13 @@ func (p *webhookPlugin) updateWebhook(req *plugin.Request, res *plugin.Response) return } - type body struct { + type updateWebhookBody struct { URL *string `json:"url"` Secret *string `json:"secret"` Events []string `json:"events"` Enabled *bool `json:"enabled"` } - b, err := plugin.JSONBody[body](req) + b, err := plugin.JSONBody[updateWebhookBody](req) if err != nil { apiError(res, 400, "BAD_REQUEST", "invalid request body") return From 65ffbecf4371d200f979680fd4b57907e4f4929e Mon Sep 17 00:00:00 2001 From: pikann22 Date: Sun, 30 Aug 2026 16:50:52 +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 9b6feed..c858ae6 100644 --- a/plugin.json +++ b/plugin.json @@ -2,7 +2,7 @@ "id": "com.paca.webhook", "displayName": "Webhooks", "description": "Sends HTTP webhooks to a URL of your choice when task activity happens in a project.", - "version": "0.1.8", + "version": "0.1.9", "minCoreVersion": "v0.13.3", "permissions": ["db.read", "db.write", "events.subscribe"], "backend": {