From f032ade9c80897db37ca9bfe6cfdf6f7c6aa8d56 Mon Sep 17 00:00:00 2001 From: Vignesh Natarajan Date: Sat, 14 Feb 2026 18:57:02 -0800 Subject: [PATCH] fix (telegram): return webhook timeout responses to prevent retry storms --- src/telegram/webhook.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/telegram/webhook.ts b/src/telegram/webhook.ts index a23f0aa30a..259fa4c7ab 100644 --- a/src/telegram/webhook.ts +++ b/src/telegram/webhook.ts @@ -19,6 +19,7 @@ import { createTelegramBot } from "./bot.js"; const TELEGRAM_WEBHOOK_MAX_BODY_BYTES = 1024 * 1024; const TELEGRAM_WEBHOOK_BODY_TIMEOUT_MS = 30_000; +const TELEGRAM_WEBHOOK_CALLBACK_TIMEOUT_MS = 10_000; export async function startTelegramWebhook(opts: { token: string; @@ -56,6 +57,8 @@ export async function startTelegramWebhook(opts: { }); const handler = webhookCallback(bot, "http", { secretToken: secret, + onTimeout: "return", + timeoutMilliseconds: TELEGRAM_WEBHOOK_CALLBACK_TIMEOUT_MS, }); if (diagnosticsEnabled) {