#23450: fix(telegram): add polling health check to detect and recover from stuck polling
channel: telegram
size: XS
Cluster:
Telegram Command Fixes
## Summary
Fixes #23448
After a `getUpdates` 409 conflict, polling can silently stop receiving updates. This adds a lightweight watchdog to detect and recover from this state.
## Changes (+36 lines)
**`src/telegram/monitor.ts`**
- Add `setInterval` watchdog that checks offset file freshness every 60s
- If file unchanged for >5 min, delete offset and restart polling
**`src/telegram/update-offset-store.ts`**
- Export `resolveTelegramUpdateOffsetPath` (was internal)
## How it works
```
Health check (every 60s):
Check offset file mtime
↓
If stale > 5 min:
Log warning → Delete offset → runner.stop()
↓
While loop continues → Polling restarts fresh
```
Minimal invasion: only adds an `if` check after `runner.task()` to decide restart vs exit.
Most Similar PRs
#11688: feat(telegram): add health check watchdog for long-polling
by rmfalco89 · 2026-02-08
75.8%
#3186: fix(telegram): sanitize update offset + lock polling
by daxiong888 · 2026-01-28
73.3%
#10850: fix(telegram): await runner.stop() to prevent polling race conditio...
by talhaorak · 2026-02-07
70.6%
#6447: fix(telegram): auto-restart polling when grammY runner exits silently
by AugmentAdvertise · 2026-02-01
69.8%
#8166: fix(telegram): lifecycle fixes for duplicate messages and auto-reco...
by cheenu1092-oss · 2026-02-03
65.4%
#22489: fix(telegram): wire up poll action in dispatch
by pierreeurope · 2026-02-21
65.4%
#23238: fix(telegram): account named "default" silently breaks inbound polling
by anillBhoi · 2026-02-22
65.3%
#6463: fix(telegram): improve timeout handling and prevent channel exits
by ai-fanatic · 2026-02-01
64.6%
#17894: fix(telegram): add missing poll action gate with input validation
by PlayerGhost · 2026-02-16
64.3%
#11347: fix: scope Telegram update offset to bot token
by anooprdawar · 2026-02-07
64.2%