fix: avoid Slack file upload API for fallback messages (#10461)

Skip calling the Slack file upload API for message types such as
fallback (e.g., Facebook and location messages) that lack actual file
data in attachments. This prevents unnecessary API calls and resolves a
Sentry error currently occurring in production.

fixes: https://github.com/chatwoot/chatwoot/issues/10460
This commit is contained in:
Sojan Jose
2024-11-26 12:56:40 +08:00
committed by GitHub
parent b9d888d8ab
commit 12a82b6459
4 changed files with 43 additions and 2 deletions

View File

@@ -69,6 +69,10 @@ class Attachment < ApplicationRecord
end
end
def with_attached_file?
[:image, :audio, :video, :file].include?(file_type.to_sym)
end
private
def file_metadata