fix: Handle Facebook reel attachment type (#13691)

Fixes https://linear.app/chatwoot/issue/PLA-96/argumenterror-reel-is-not-a-valid-file-type-argumenterror
Fixes a crash in `when a user shares a Facebook reel via Messenger.
Facebook sends these attachments with `type: "reel"`, which isn't a
valid `file_type` enum value on the Attachment model (only `ig_reel`
exists, matching Instagram's format).

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
Muhsin Keloth
2026-03-06 08:49:41 +04:00
committed by GitHub
parent 059506b1db
commit 598ece9a2d
4 changed files with 107 additions and 5 deletions

View File

@@ -89,7 +89,7 @@ class Attachment < ApplicationRecord
when :embed
embed_data
else
file_metadata
file.attached? ? file_metadata : { data_url: external_url, thumb_url: '' }
end
end