telegram: shut down sidecar bot after export #109

Merged
pecheny merged 2 commits from fix-telegram-sidecar-teardown into main 2026-07-01 16:15:39 +00:00
Owner

The sidecar bot (python-telegram-bot Application) was started as a daemon thread running getUpdates polling under loop.run_forever() and was never stopped. In the long-lived Qt GUI process the poller outlived the export task, so a later export (or a lingering prior process) started a second poller on the same token and hit telegram.error.Conflict: terminated by other getUpdates request.

Make TelegramSidecarBot stoppable (stop() schedules loop.stop(); run() tears the updater/application down on its own loop), have run_bot_in_thread return the bot instance, and add TelegramExporter.close() invoked from a finally around export() so the poller is released on success or failure.

🤖 Generated with Claude Code

The sidecar bot (python-telegram-bot `Application`) was started as a daemon thread running `getUpdates` polling under `loop.run_forever()` and was never stopped. In the long-lived Qt GUI process the poller outlived the export task, so a later export (or a lingering prior process) started a second poller on the same token and hit `telegram.error.Conflict: terminated by other getUpdates request`. Make `TelegramSidecarBot` stoppable (`stop()` schedules `loop.stop()`; `run()` tears the updater/application down on its own loop), have `run_bot_in_thread` return the bot instance, and add `TelegramExporter.close()` invoked from a `finally` around `export()` so the poller is released on success or failure. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>7f695540 - Release chgksuite v1.3.0b4</li></ul> [Compare with previous version](/alexander-pecheny/chgksuite/-/merge_requests/59/diffs?diff_id=1881151990&start_sha=8e636947ca4c6b95dfbd28a65fc656a8b8524d32)
Author
Owner

mentioned in commit bf4596bcec

mentioned in commit bf4596bcec8f6619bdc160d77a21667db1168a13
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pecheny/chgksuite!109
No description provided.