From 0a17976913adde20a77a380337ca16a39af7f1e8 Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Thu, 4 Dec 2025 16:09:04 +0530 Subject: [PATCH] fix: Filter out unsupported ephemeral message attachments (#13003) Fixes https://linear.app/chatwoot/issue/CW-6070/argumenterror-ephemeral-is-not-a-valid-file-type-argumenterror **Problem** The instagram webhooks containing ephemeral (disappearing) message were causing ArgumentError exceptions because this attachment type is not supported and was not in the enum validation. **Solution** - Added ephemeral to the unsupported_file_type? filter - Ephemeral attachments are now silently filtered out before processing, following the same pattern as existing unsupported types (template, unsupported_type) --- app/builders/messages/messenger/message_builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/builders/messages/messenger/message_builder.rb b/app/builders/messages/messenger/message_builder.rb index 7bc571f6c..8821da9d5 100644 --- a/app/builders/messages/messenger/message_builder.rb +++ b/app/builders/messages/messenger/message_builder.rb @@ -101,6 +101,6 @@ class Messages::Messenger::MessageBuilder private def unsupported_file_type?(attachment_type) - [:template, :unsupported_type].include? attachment_type.to_sym + [:template, :unsupported_type, :ephemeral].include? attachment_type.to_sym end end