← Back to PRs

#22942: fix(slack): parse generic attachment text for inbound events

by danielalkurdi open 2026-02-21 21:07 View on GitHub →
channel: slack size: S
## 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