Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions plugins/platforms/telegram/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1781,6 +1781,18 @@ async def _handle_polling_network_error(self, error: Exception) -> None:

await self._drain_polling_connections()

# Guard against self._app being torn down by the supervisor while
# we were sleeping during the reconnect delay. The stop() call
# above is already guarded but start_polling() was not — accessing
# self._app.updater when self._app is None raises AttributeError
# and silently kills the reconnect loop. (#55992)
if not self._app or not self._app.updater:
logger.warning(
"[%s] Telegram app destroyed during reconnect delay (attempt %d) — aborting",
self.name, attempt,
)
return

try:
await self._app.updater.start_polling(
allowed_updates=Update.ALL_TYPES,
Expand Down
Loading