fix: Check the file attachment URL exists before downloading attachments in Telegram. (#8679)
In rare cases, the API call to Telegram for the file path fails. We were logging the error in sentry, switching to logs instead. Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
@@ -100,6 +100,12 @@ class Telegram::IncomingMessageService
|
||||
def attach_files
|
||||
return unless file
|
||||
|
||||
file_download_path = inbox.channel.get_telegram_file_path(file[:file_id])
|
||||
if file_download_path.blank?
|
||||
Rails.logger.info "Telegram file download path is blank for #{file[:file_id]} : inbox_id: #{inbox.id}"
|
||||
return
|
||||
end
|
||||
|
||||
attachment_file = Down.download(
|
||||
inbox.channel.get_telegram_file_path(file[:file_id])
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user