Title: Lazy listeners do not work with Chalice local testing server · Issue #490 · slackapi/bolt-python · GitHub
Open Graph Title: Lazy listeners do not work with Chalice local testing server · Issue #490 · slackapi/bolt-python
X Title: Lazy listeners do not work with Chalice local testing server · Issue #490 · slackapi/bolt-python
Description: I want to perform operations when a member has joined a channel which takes more than 5 seconds, but I'm getting BrokenPipeError: [Errno 32] Broken pipe. The minimal step to reproduce the same has been shown below while using the lazy li...
Open Graph Description: I want to perform operations when a member has joined a channel which takes more than 5 seconds, but I'm getting BrokenPipeError: [Errno 32] Broken pipe. The minimal step to reproduce the same has ...
X Description: I want to perform operations when a member has joined a channel which takes more than 5 seconds, but I'm getting BrokenPipeError: [Errno 32] Broken pipe. The minimal step to reproduce the same ...
Opengraph URL: https://github.com/slackapi/bolt-python/issues/490
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Lazy listeners do not work with Chalice local testing server","articleBody":"I want to perform operations when a member has joined a channel which takes more than 5 seconds, but I'm getting **BrokenPipeError: [Errno 32] Broken pipe**.\r\n\r\n\r\nThe minimal step to reproduce the same has been shown below while using the lazy listener it waits for 10 seconds before responding back.\r\n\r\n\r\n### Reproducible in:\r\n\r\n```python\r\nfrom chalice import Chalice, Response\r\nfrom slack_bolt import App\r\nfrom slack_bolt.adapter.aws_lambda.chalice_handler import ChaliceSlackRequestHandler\r\n\r\nbolt_app = App(process_before_response=True)\r\napp = Chalice(app_name='chalice_app_name')\r\nslack_handler = ChaliceSlackRequestHandler(app=bolt_app, chalice=app)\r\n\r\n\r\n@bolt_app.event(\"message\")\r\ndef handle_message_events(body, logger):\r\n logger.info(body['event']['text'])\r\n\r\n\r\ndef respond_to_slack_within_3_seconds(ack):\r\n ack(\"Accepted!\")\r\n\r\n\r\ndef say_it(say):\r\n time.sleep(10)\r\n say(\"Done!\")\r\n\r\n\r\nbolt_app.event(\"member_joined_channel\")(\r\n ack=respond_to_slack_within_3_seconds, lazy=[say_it]\r\n)\r\n\r\n\r\n@app.route(\r\n \"/slack/events\",\r\n methods=[\"POST\"],\r\n content_types=[\"application/x-www-form-urlencoded\", \"application/json\"],\r\n)\r\ndef events() -> Response:\r\n return slack_handler.handle(app.current_request)\r\n\r\n```\r\n\r\n#### The `slack_bolt` version\r\nslack-bolt==1.9.1\r\nslack-sdk==3.11.1\r\n\r\n#### Python runtime version\r\nPython 3.6.15\r\n\r\n#### OS info\r\nUbuntu 20.04.3 LTS\r\n\r\n#### Steps to reproduce:\r\n1. While handling of any Slack event (e.g. handle_member_joined event)\r\n2. Use lazy listener and wait for more than 3 seconds before responding back to Slack \r\n\r\n### Expected result:\r\nSince the event is acknowledging the Slack within 3 seconds irrespective of the lazy listener function time, it should have processed the same.\r\n\r\n### Actual result:\r\n\r\n\r\n\r\n\r\n## Requirements\r\n\r\nPlease read the [Contributing guidelines](https://github.com/slackapi/bolt-python/blob/main/.github/contributing.md) and [Code of Conduct](https://slackhq.github.io/code-of-conduct) before creating this issue or pull request. By submitting, you are agreeing to those rules.\r\n","author":{"url":"https://github.com/Cyb-Nikh","@type":"Person","name":"Cyb-Nikh"},"datePublished":"2021-10-08T09:42:20Z","url":"https://github.com/slackapi/bolt-python/issues/490"}
| 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:9419e3f8-50ad-39b6-f4c5-4da008696324 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D27E:729DB:15A54EA:1CD6CF8:6AFEB8E4 |
| html-safe-nonce | 9ea9d9133b92b798b0d8607a597b79bdd641faef4309c08dffea22f6d85cb120 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjdFOjcyOURCOjE1QTU0RUE6MUNENkNGODo2QUZFQjhFNCIsInZpc2l0b3JfaWQiOiI4NDkxOTI5MTg2NzY2NjAwNDIwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8dace7190cd5da757f8cb10cf66d1d3281fb87de217f36f705283a792a550292 |
| hovercard-subject-tag | issue:1020902170 |
| 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/slackapi/bolt-python/490/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eff9265985f8bc7a9de0ba0e1eeb90909eab414ca93bdc4cb88c027dd59a87c6/slackapi/bolt-python/issues/490 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eff9265985f8bc7a9de0ba0e1eeb90909eab414ca93bdc4cb88c027dd59a87c6/slackapi/bolt-python/issues/490 |
| og:image:alt | I want to perform operations when a member has joined a channel which takes more than 5 seconds, but I'm getting BrokenPipeError: [Errno 32] Broken pipe. The minimal step to reproduce the same has ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Cyb-Nikh |
| hostname | github.com |
| expected-hostname | github.com |
| None | 95b2753c978240785d6cca00783c00a371b2d7d9879bb32e305170a1b19bd28e |
| turbo-cache-control | no-preview |
| go-import | github.com/slackapi/bolt-python git https://github.com/slackapi/bolt-python.git |
| octolytics-dimension-user_id | 6962987 |
| octolytics-dimension-user_login | slackapi |
| octolytics-dimension-repository_id | 268795735 |
| octolytics-dimension-repository_nwo | slackapi/bolt-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 268795735 |
| octolytics-dimension-repository_network_root_nwo | slackapi/bolt-python |
| 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 | 3f25273206cd841171bca0002261ae4c9757d934 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width