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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user