chatwoot/app/services/telegram
Muhsin Keloth 0ad47d87f4
fix: Use Faraday for Telegram document uploads to fix large file failures (#13397)
Fixes
https://linear.app/chatwoot/issue/CW-6415/sending-large-attachments-11mb-via-telegram-channels-fails-with-http

 #### Issue
Sending large attachments (~11MB) via Telegram channels fails with HTTP
502 (Bad Gateway) and 413 (Request Entity Too Large) errors. The issue
is caused by HTTParty's built-in multipart encoding, which reads the
entire file into an in-memory string before constructing the request
body. For large files, this produces a malformed multipart request that
Telegram's API proxy rejects.

#### Solution

Replace HTTParty with Faraday + multipart-post (both already available
in the project) for the sendDocument multipart upload. The
multipart-post gem streams file content directly from disk into the HTTP
request, producing a correctly formed multipart body that Telegram
accepts for large files.

---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2026-02-10 14:25:25 -08:00
..
incoming_message_service.rb feat: Enable lock to single thread settings for Telegram (#12367) 2025-09-24 11:35:14 +05:30
param_helpers.rb feat(channel): add support for Telegram Business bots (#10181) (#11663) 2025-06-16 20:35:23 -07:00
send_attachments_service.rb fix: Use Faraday for Telegram document uploads to fix large file failures (#13397) 2026-02-10 14:25:25 -08:00
send_on_telegram_service.rb feat: Ability to send attachments to telegram (#3108) 2021-10-01 01:45:29 +05:30
update_message_service.rb feat(channel): add support for Telegram Business bots (#10181) (#11663) 2025-06-16 20:35:23 -07:00