#22942: fix(slack): parse generic attachment text for inbound events
channel: slack
size: S
Cluster:
Slack and Signal Enhancements
## Summary
- parse text from generic Slack attachments (not only `is_share` forwarded payloads)
- include `pretext`, `text`, `fallback`, and `fields` in normalized inbound message body
- keep media download behavior restricted to forwarded/share attachments for safety
- add a verbose drop log when body is empty after attachment/media normalization
## Why
GitHub/Vercel Slack app notifications often arrive as attachment-only bot messages without `is_share=true`. Those messages were being dropped as empty, so automation never saw deployment status updates.
## Validation
- `pnpm vitest run src/slack/monitor/media.test.ts src/slack/monitor/message-handler/prepare.test.ts`
- `pnpm exec oxlint --type-aware src/slack/monitor/media.ts src/slack/monitor/message-handler/prepare.ts src/slack/types.ts src/slack/monitor/media.test.ts src/slack/monitor/message-handler/prepare.test.ts`
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Expands Slack attachment parsing to extract text from generic bot attachments (like GitHub/Vercel notifications), not just forwarded messages. Previously, attachment-only bot messages were dropped as empty, preventing automation from seeing deployment status updates.
**Key changes:**
- Parses `pretext`, `fallback`, `title`, and `fields` from all attachments
- Deduplicates fallback text when it matches pretext/text
- Restricts media downloads to forwarded attachments (`is_share: true`) for safety
- Adds verbose logging when messages are dropped due to empty body
- Updates heading format from "Forwarded message" to "Slack attachment" to reflect broader scope
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The implementation is well-tested (37 passing tests), maintains backward compatibility, and follows defensive coding practices. Media downloads remain restricted to forwarded attachments for security. The deduplication logic correctly prevents duplicate text. All edge cases are covered in tests.
- No files require special attention
<sub>Last reviewed commit: c5c755d</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#9963: fix(slack): extract text from forwarded message attachments
by coreyonbreeze · 2026-02-05
85.2%
#20480: feat(slack): extract and surface attachment notes in messages
by olyashok · 2026-02-19
84.7%
#18763: fix(slack): add auth header when downloading forwarded attachment i...
by amabito · 2026-02-17
84.5%
#15879: Support for forwarded messages and file_shared messages in slack
by olyashok · 2026-02-14
84.0%
#15095: fix(slack): process all file attachments instead of only the first
by Lar000ki · 2026-02-13
83.6%
#14847: fix(slack): preserve auth across Slack-hosted file redirects
by natashache · 2026-02-12
82.8%
#20479: fix(slack): keep replies flowing for oversized file uploads
by olyashok · 2026-02-19
81.6%
#21230: Fix [Bug]: Discord attachments silently missing (Fixes #19956)
by vasujain00 · 2026-02-19
78.6%
#4665: fix(slack): reject HTML responses when downloading media
by tumf · 2026-01-30
78.1%
#7404: feat(slack): add Socket Mode bot + auto-join + bridge scaffolding; ad…
by zprager · 2026-02-02
77.8%