← Back to PRs

#6089: fix(slack): add reactionNotifications config check to reactions handler

by jontsai open 2026-02-01 08:23 View on GitHub →
channel: slack size: XS
## Problem The Slack reactions handler (`src/slack/monitor/events/reactions.ts`) processes all reactions unconditionally, ignoring the `reactionNotifications` config setting. Even with `channels.slack.reactionNotifications: "own"` configured, reaction events are not filtered appropriately. ## Root Cause Unlike Telegram's implementation (`src/telegram/bot.ts:379-382`), the Slack handler doesn't check `ctx.reactionMode` before processing reactions. **Telegram (working):** ```typescript const reactionMode = telegramCfg.reactionNotifications ?? "own"; if (reactionMode === "off") return; if (user?.is_bot) return; if (reactionMode === "own" && !wasSentByBot(chatId, messageId)) return; ``` **Slack (before this fix):** ```typescript const handleReactionEvent = async (event: SlackReactionEvent, action: string) => { // ... just processes everything without checking reactionMode ``` ## Solution Added `reactionNotifications` config filtering at the start of `handleReactionEvent`: - Check `reactionMode` config (off/own/all/allowlist) - Skip bot's own reactions (consistent with other providers) - For `own` mode, only process reactions on messages sent by the bot - For `allowlist` mode, only process reactions from allowlisted users ## Testing - [x] Verified `ctx.reactionMode`, `ctx.reactionAllowlist`, and `ctx.botUserId` are available on `SlackMonitorContext` - [x] TypeScript compiles without errors (`npx tsc --noEmit`) - [x] Lint passes for changed file (`pnpm lint -- src/slack/monitor/events/reactions.ts`) - [ ] Runtime testing pending (would appreciate maintainer testing on live Slack instance) Supersedes #2638 --- ## AI Disclosure 🤖 - [x] **AI-assisted:** This PR was developed with Claude (via OpenClaw) - [x] **Testing level:** Lightly tested (type-check + lint; no live Slack testing) - [x] **I understand what this code does:** Yes - adds early-return guards matching Telegram's reaction filtering pattern **Context:** Discovered this gap while configuring my own OpenClaw Slack integration. The fix mirrors the existing Telegram implementation pattern.

Most Similar PRs