From f904858c565a3929e7de9fe2885b344e6084b656 Mon Sep 17 00:00:00 2001 From: Dylan Neve Date: Thu, 29 Jan 2026 23:33:43 +0000 Subject: [PATCH] fix(telegram): handle 'file is too big' error for large files (#4232) --- CHANGELOG.md | 2 +- src/telegram/bot-handlers.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a134359f5..34643da71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,7 +45,7 @@ Status: beta. - Gateway: prevent crashes on transient network errors, suppress AbortError/unhandled rejections, sanitize error responses, clean session locks on exit, and harden reverse proxy handling for unauthenticated proxied connects. (#2980, #2451, #2483, #1795) - Config: auto-migrate legacy state/config paths; honor state dir overrides. - Packaging: include missing dist/shared and dist/link-understanding outputs in npm tarball installs. -- Telegram: avoid silent empty replies, improve polling/network recovery, handle video notes, keep DM thread sessions, ignore non-forum message_thread_id, centralize API error logging, include AccountId in native command context. (#3796, #3013, #2905, #2731, #2492, #2942) +- Telegram: fix "file is too big" error handling for large forwarded files; avoid silent empty replies, improve polling/network recovery, handle video notes, keep DM thread sessions, ignore non-forum message_thread_id, centralize API error logging, include AccountId in native command context. (#4232, #3796, #3013, #2905, #2731, #2492, #2942) - Telegram: preserve reasoning tags inside code blocks. (#3952) Thanks @vinaygit18. - Discord: restore username resolution, resolve outbound usernames to IDs, honor threadId replies, guard forum thread access. (#3131, #2649) - BlueBubbles: coalesce URL link previews, improve reaction handling, preserve reply-tag GUIDs. (#1981, #1641) diff --git a/src/telegram/bot-handlers.ts b/src/telegram/bot-handlers.ts index 477b98280..69f8f40cd 100644 --- a/src/telegram/bot-handlers.ts +++ b/src/telegram/bot-handlers.ts @@ -634,7 +634,10 @@ export const registerTelegramHandlers = ({ media = await resolveMedia(ctx, mediaMaxBytes, opts.token, opts.proxyFetch); } catch (mediaErr) { const errMsg = String(mediaErr); - if (errMsg.includes("exceeds") && errMsg.includes("MB limit")) { + if ( + (errMsg.includes("exceeds") && errMsg.includes("MB limit")) || + errMsg.includes("file is too big") + ) { const limitMb = Math.round(mediaMaxBytes / (1024 * 1024)); await withTelegramApiErrorLogging({ operation: "sendMessage",