From ffe6b736632b23568f86283aa90e0d4d97ca5953 Mon Sep 17 00:00:00 2001 From: singret <100959986+singret@users.noreply.github.com> Date: Mon, 25 May 2026 17:52:17 +0000 Subject: [PATCH] fix(slack): refresh incident card and post confirmation after reaction ack/resolve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When ✅ or 🔴 reactions were added to the incident card, the status was updated in the DB and timeline, but the Slack card stayed stale and no team-visible confirmation was posted. Mirrors the behaviour of the button handler: re-fetches the updated incident, calls refreshIncidentCard, and posts a public "<@user> acknowledged/resolved INC-N via reaction" message. Also adds a missing early return on UpdateIncidentStatus error so the confirmation path is not reached when the update fails. --- backend/internal/services/slack_event_handler.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/backend/internal/services/slack_event_handler.go b/backend/internal/services/slack_event_handler.go index 8f99b25..756ea03 100644 --- a/backend/internal/services/slack_event_handler.go +++ b/backend/internal/services/slack_event_handler.go @@ -1045,7 +1045,22 @@ func (h *SlackEventHandler) handleReactionAdded(ev *slackevents.ReactionAddedEve "reaction", ev.Reaction, "target_status", targetStatus, "error", err) + return + } + + // Refresh the incident card so the Slack message reflects the new status + if updated, err := h.incidentService.GetIncident(incident.ID, 0); err == nil { + h.refreshIncidentCard(updated) } + + // Post public confirmation so the whole team sees who acted + actionText := "acknowledged" + if targetStatus == models.IncidentStatusResolved { + actionText = "resolved" + } + _, _ = h.chatService.PostMessage(incident.SlackChannelID, Message{ + Text: fmt.Sprintf("<@%s> %s INC-%d via reaction", ev.User, actionText, incident.IncidentNumber), + }) } func (h *SlackEventHandler) postToThread(channelID, threadTS, text string) (string, error) {