Skip to content

fix(telegram): make polling conflict retryable with longer backoff - #23806

Closed
im-kris wants to merge 1 commit into
NousResearch:mainfrom
im-kris:fix/telegram-conflict-retryable
Closed

fix(telegram): make polling conflict retryable with longer backoff#23806
im-kris wants to merge 1 commit into
NousResearch:mainfrom
im-kris:fix/telegram-conflict-retryable

Conversation

@im-kris

@im-kris im-kris commented May 11, 2026

Copy link
Copy Markdown

Issue: Telegram getUpdates session survives the old gateway process on
the server side for an unknown grace period. During that window every
new getUpdates call gets 409 Conflict. The old code retried 3×10s and
then gave up permanently (retryable=False), requiring manual restart.

Fix: extend retries to 5×20s and mark the error retryable so the
background reconnection loop keeps trying if needed.

Closes #23783

When the gateway restarts, Telegram may take longer than 30s to release
the old getUpdates session. Previously the adapter gave up permanently
after 3x10s retries (retryable=False), leaving the platform dead until
manual restart. Raise retries to 5x20s and mark the error retryable so
the background reconnection loop keeps trying until the session expires.
@teknium1

Copy link
Copy Markdown
Contributor

Closing in favor of #25630 (more thorough fix for the same #23783 family).

Your tactical patch (3→5 retries, 10s→20s backoff, retryable=True) doesn't address the worst bug in that area: when the retry's own start_polling() raises, the handler silently returns. updater.running=False, no fatal set, gateway reports 'connected', no messages flow. Manual restart required.

#25630 fixes both stages: (1) the 409 window timing, and (2) the silent limbo after a failed retry — by scheduling a self-rescheduling attempt instead of dead-ending.

Thanks for opening the conversation on #23783.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram bot token already in use after hermes update — gateway fails to start, Telegram broken afterwards

3 participants