fix(slack): ack reactions not executing due to early return on empty text
The ack reaction logic was placed after a check that returns null if the message has no text content. This prevented ack reactions from working when users mention the bot without additional text. Moved ack reaction handling before the text content check so that acknowledgment reactions work regardless of message content. Fixes issue where ack reactions were configured correctly but never appeared in Slack channels or DMs.
This commit is contained in:
parent
109ac1c549
commit
377c40378d
@ -337,8 +337,9 @@ export async function prepareSlackMessage(params: {
|
||||
maxBytes: ctx.mediaMaxBytes,
|
||||
});
|
||||
const rawBody = (message.text ?? "").trim() || media?.placeholder || "";
|
||||
if (!rawBody) return null;
|
||||
|
||||
// Handle ack reactions BEFORE checking for message content
|
||||
// This ensures reactions work even for messages with no text body
|
||||
const ackReaction = resolveAckReaction(cfg, route.agentId);
|
||||
const ackReactionValue = ackReaction ?? "";
|
||||
|
||||
@ -372,6 +373,8 @@ export async function prepareSlackMessage(params: {
|
||||
)
|
||||
: null;
|
||||
|
||||
if (!rawBody) return null;
|
||||
|
||||
const roomLabel = channelName ? `#${channelName}` : `#${message.channel}`;
|
||||
const preview = rawBody.replace(/\s+/g, " ").slice(0, 160);
|
||||
const inboundLabel = isDirectMessage
|
||||
|
||||
Loading…
Reference in New Issue
Block a user