From 0d8ec1e8e7af0ae42e7cc7c53a223f91a40ffe00 Mon Sep 17 00:00:00 2001 From: egutierrez Date: Mon, 1 Jun 2026 15:25:25 +0200 Subject: [PATCH] fix(jira): emit card.created so card creation syncs to Jira handleCreateCard only published board.invalidated, which is not in the module event filter, so the dispatcher dropped it and jiraHandler.create never ran. Newly created cards therefore never produced a Jira issue, unlike moves (card.moved) and chat (message.created) which already synced. Emit card.created after assignee/tags are applied so the synced issue carries them. board.invalidated is kept for the SPA refetch path. No loop risk (card.created fires only from the HTTP handler) and no double-create (board.invalidated stays out of the filter). --- backend/handlers.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/handlers.go b/backend/handlers.go index 1b29baf..992f667 100644 --- a/backend/handlers.go +++ b/backend/handlers.go @@ -203,6 +203,13 @@ func handleCreateCard(db *DB, hub *EventHub) http.HandlerFunc { serverError(w, err) return } + // card.created drives outbound modules (Jira) to create the issue. + // Emitted after assignee/tags are applied so the synced issue carries + // them. board.invalidated stays for the SPA's refetch path. + hub.PublishJSON("card.created", c.ID, "", map[string]string{ + "card_id": c.ID, + "column_id": body.ColumnID, + }) publishInvalidated(hub, c.ID, body.ColumnID) infra.HTTPJSONResponse(w, http.StatusCreated, c) }