]> git.giacomolli.uk - onechat/commitdiff
Limit the time of each Telegram send call
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Sat, 7 Nov 2026 13:51:13 +0000 (10:51 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Sat, 7 Nov 2026 13:51:13 +0000 (10:51 -0300)
Each sendMessage and sendChatAction call gets its own limit of 30 s,
through a child context of the call. Before, only getUpdates had a
limit, so a connection that stopped without a close, such as after a
network change, held the sender until TCP gave up, and no reply, error
or typing action reached the chat in that time.

A call that times out fails with the same network error as the other
network failures, so the sender waits and tries again, and the error
text holds no token and no URL. The HTTP client keeps no timeout of its
own, because the long poll of getUpdates needs a longer limit. A stop of
the daemon still ends a call in progress at once, because the limit is a
child of the daemon context.

Issue: a143bd8


No differences found