#15095: fix(slack): process all file attachments instead of only the first
channel: slack
stale
size: S
Cluster:
Slack Integration Improvements
## Summary
- `resolveSlackMedia()` now returns all successfully fetched files
instead of returning after the first one
- Added `buildSlackMediaPayload()` helper following the existing
Discord pattern, populating both singular and plural media fields
- Updated tests for new array return type + added multi-file test
Fixes #15190
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates Slack inbound media handling so `resolveSlackMedia()` returns *all* successfully fetched attachments rather than stopping after the first. `prepareSlackMessage()` is updated to consume the new array return type and to populate both singular (`MediaPath`/`MediaUrl`/`MediaType`) and plural (`MediaPaths`/`MediaUrls`/`MediaTypes`) context fields via a new `buildSlackMediaPayload()` helper, matching the pattern used by other providers.
Tests were updated to assert the new empty-array behavior and to cover multi-file handling.
<h3>Confidence Score: 5/5</h3>
- This PR appears safe to merge with minimal risk.
- Changes are localized to Slack inbound media resolution and message preparation, with tests updated/expanded to cover the new multi-file behavior and the return-type change. Downstream context fields already support plural media arrays and similar providers use the same local-path-as-URL pattern.
- No files require special attention
<sub>Last reviewed commit: 53fe2f4</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
#8684: fix(slack): add title param and channel resolution for file upload
by shuans · 2026-02-04
83.7%
#22942: fix(slack): parse generic attachment text for inbound events
by danielalkurdi · 2026-02-21
83.6%
#14847: fix(slack): preserve auth across Slack-hosted file redirects
by natashache · 2026-02-12
82.0%
#20479: fix(slack): keep replies flowing for oversized file uploads
by olyashok · 2026-02-19
81.1%
#18763: fix(slack): add auth header when downloading forwarded attachment i...
by amabito · 2026-02-17
79.7%
#15879: Support for forwarded messages and file_shared messages in slack
by olyashok · 2026-02-14
79.2%
#21230: Fix [Bug]: Discord attachments silently missing (Fixes #19956)
by vasujain00 · 2026-02-19
78.4%
#4665: fix(slack): reject HTML responses when downloading media
by tumf · 2026-01-30
77.0%
#20913: fix: intercept Discord embed images to enforce mediaMaxMb
by MumuTW · 2026-02-19
76.7%
#8024: fix(slack): resolve channel names via directory for cross-account m...
by emma-digital-assistant · 2026-02-03
76.3%