Title: Check promise states in conversation timeout callback | timeouts & nested conversations · Issue #2407 · python-telegram-bot/python-telegram-bot · GitHub
Open Graph Title: Check promise states in conversation timeout callback | timeouts & nested conversations · Issue #2407 · python-telegram-bot/python-telegram-bot
X Title: Check promise states in conversation timeout callback | timeouts & nested conversations · Issue #2407 · python-telegram-bot/python-telegram-bot
Description: When using ConversationHandler with async handler callbacks and timeout, the timeout may trigger falsely. This is the case, when the callback returns CH.END, which currently the timeout callback doesn't know. This can be solved by making...
Open Graph Description: When using ConversationHandler with async handler callbacks and timeout, the timeout may trigger falsely. This is the case, when the callback returns CH.END, which currently the timeout callback do...
X Description: When using ConversationHandler with async handler callbacks and timeout, the timeout may trigger falsely. This is the case, when the callback returns CH.END, which currently the timeout callback do...
Opengraph URL: https://github.com/python-telegram-bot/python-telegram-bot/issues/2407
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Check promise states in conversation timeout callback | timeouts & nested conversations","articleBody":"When using `ConversationHandler` with async handler callbacks and timeout, the timeout may trigger falsely. This is the case, when the callback returns `CH.END`, which currently the timeout callback doesn't know.\r\n\r\nThis can be solved by making `CH._trigger_timeout` check if the current conversations state as follows:\r\n\r\n```python\r\nif isinstance(state, Promise):\r\n if state.done and state.result() == CH.END:\r\n return\r\n```\r\n\r\nThis will still fail, if the promise is not yet done, when the timeout triggers but\r\n\r\n1. it's a best effort solution\r\n2. if a promise takes longer to run than the timeout is, then there are probably some other issues in the users code\r\n\r\nAlso when looking at the code I noticed that we don't handle nested conversations in `CH._trigger_timeout`, so that's a good opportunity to fix that …","author":{"url":"https://github.com/Bibo-Joshi","@type":"Person","name":"Bibo-Joshi"},"datePublished":"2021-03-01T16:19:36Z","url":"https://github.com/python-telegram-bot/python-telegram-bot/issues/2407"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:83888886-5a6b-2991-de16-da8ecbe8193d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8C82:386611:ADE757:E3DB82:6B0266CF |
| html-safe-nonce | ceadb350405f04ea6418602f2472b4a80d0859f29beb85a10ebd8716ad5c33ef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzgyOjM4NjYxMTpBREU3NTc6RTNEQjgyOjZCMDI2NkNGIiwidmlzaXRvcl9pZCI6IjMxMzQxNDgzMzUxNTE2MTI5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1f7b48306830f17b856a958b505adc91c683cdc91e563227700c7d83547891eb |
| hovercard-subject-tag | issue:819026953 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-telegram-bot/python-telegram-bot/2407/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5faf1c794d5dfb78e75b274b71d54a0396c435fbafad2ba5f1d770ac1ffc088c/python-telegram-bot/python-telegram-bot/issues/2407 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5faf1c794d5dfb78e75b274b71d54a0396c435fbafad2ba5f1d770ac1ffc088c/python-telegram-bot/python-telegram-bot/issues/2407 |
| og:image:alt | When using ConversationHandler with async handler callbacks and timeout, the timeout may trigger falsely. This is the case, when the callback returns CH.END, which currently the timeout callback do... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Bibo-Joshi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-telegram-bot/python-telegram-bot git https://github.com/python-telegram-bot/python-telegram-bot.git |
| octolytics-dimension-user_id | 16178365 |
| octolytics-dimension-user_login | python-telegram-bot |
| octolytics-dimension-repository_id | 38696925 |
| octolytics-dimension-repository_nwo | python-telegram-bot/python-telegram-bot |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38696925 |
| octolytics-dimension-repository_network_root_nwo | python-telegram-bot/python-telegram-bot |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width