← Back to PRs

#23450: fix(telegram): add polling health check to detect and recover from stuck polling

by Elarwei001 open 2026-02-22 10:06 View on GitHub →
channel: telegram size: XS
## 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