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)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user