Skip to content

Commit ee1cc18

Browse files
dogzzdogzzclaude
andcommitted
fix(slack): allow file_share subtype in thread follow-ups
Slack sends message events with subtype "file_share" when users attach files in threads. The previous code blocked all subtypes, which prevented image/audio attachments in thread follow-ups from being processed. Now only skip subtypes that are truly non-user messages (edits, deletes, joins, leaves). Added debug logging for message event routing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 68a1b77 commit ee1cc18

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

src/slack.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,26 @@ pub async fn run_slack_adapter(
257257
}
258258
"message" => {
259259
// Handle thread follow-ups without @mention.
260-
// Skip bot messages and subtypes (join/leave/edits).
260+
// Skip bot messages and subtypes that aren't real user messages.
261261
let has_thread = event["thread_ts"].is_string();
262262
let is_bot = event["bot_id"].is_string()
263263
|| event["subtype"].as_str() == Some("bot_message");
264-
let has_subtype = event["subtype"].is_string();
265-
if has_thread && !is_bot && !has_subtype {
264+
let subtype = event["subtype"].as_str().unwrap_or("");
265+
let has_files = event["files"].is_array();
266+
debug!(
267+
has_thread,
268+
is_bot,
269+
subtype,
270+
has_files,
271+
text = event["text"].as_str().unwrap_or(""),
272+
"message event received"
273+
);
274+
let skip_subtype = matches!(subtype,
275+
"message_changed" | "message_deleted" |
276+
"channel_join" | "channel_leave" |
277+
"channel_topic" | "channel_purpose"
278+
);
279+
if has_thread && !is_bot && !skip_subtype {
266280
handle_message(
267281
event,
268282
false,

0 commit comments

Comments
 (0)