fix(telegram): bound outbound request timeouts · openclaw/openclaw@071e761
obviyus
·
2026-04-29
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -12,8 +12,15 @@ describe("resolveTelegramRequestTimeoutMs", () => {
|
12 | 12 | expect(resolveTelegramRequestTimeoutMs("getupdates")).toBe(45_000); |
13 | 13 | }); |
14 | 14 | |
| 15 | +it("bounds outbound delivery methods", () => { |
| 16 | +expect(resolveTelegramRequestTimeoutMs("sendmessage")).toBe(20_000); |
| 17 | +expect(resolveTelegramRequestTimeoutMs("sendchataction")).toBe(10_000); |
| 18 | +expect(resolveTelegramRequestTimeoutMs("editmessagetext")).toBe(15_000); |
| 19 | +expect(resolveTelegramRequestTimeoutMs("sendphoto")).toBe(30_000); |
| 20 | +}); |
| 21 | + |
15 | 22 | it("does not assign hard timeouts to unrelated Telegram methods", () => { |
16 | | -expect(resolveTelegramRequestTimeoutMs("sendmessage")).toBeUndefined(); |
| 23 | +expect(resolveTelegramRequestTimeoutMs("answercallbackquery")).toBeUndefined(); |
17 | 24 | expect(resolveTelegramRequestTimeoutMs(null)).toBeUndefined(); |
18 | 25 | }); |
19 | 26 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,8 +2,24 @@ const TELEGRAM_REQUEST_TIMEOUTS_MS = {
|
2 | 2 | // Bound startup/control-plane calls so the gateway cannot report Telegram as |
3 | 3 | // healthy while provider startup is still hung on Bot API setup. |
4 | 4 | deletewebhook: 15_000, |
| 5 | +deletemessage: 15_000, |
| 6 | +editforumtopic: 15_000, |
| 7 | +editmessagetext: 15_000, |
| 8 | +getchat: 15_000, |
| 9 | +getfile: 30_000, |
5 | 10 | getme: 15_000, |
6 | 11 | getupdates: 45_000, |
| 12 | +pinchatmessage: 15_000, |
| 13 | +sendanimation: 30_000, |
| 14 | +sendaudio: 30_000, |
| 15 | +sendchataction: 10_000, |
| 16 | +senddocument: 30_000, |
| 17 | +sendmessage: 20_000, |
| 18 | +sendmessagedraft: 20_000, |
| 19 | +sendphoto: 30_000, |
| 20 | +sendvideo: 30_000, |
| 21 | +sendvoice: 30_000, |
| 22 | +setmessagereaction: 10_000, |
7 | 23 | setwebhook: 15_000, |
8 | 24 | } as const; |
9 | 25 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。