| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| matchers: Optional[Sequence[Callable[..., bool]]] = None, | ||
| middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, | ||
| auto_acknowledge: bool = True, | ||
| acknowledgement_timeout: int = 3, |
There was a problem hiding this comment.
Should we name this ack_timeout rather then acknowledgement_timeout?
Sorry, something went wrong.
There was a problem hiding this comment.
thought: ack_timeout makes sense to me and matches the ack parameter well! 📚 ✨
Sorry, something went wrong.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1351 +/- ##
==========================================
- Coverage 90.96% 90.96% -0.01%
==========================================
Files 222 222
Lines 7507 7517 +10
==========================================
+ Hits 6829 6838 +9
- Misses 678 679 +1 ☔ View full report in Codecov by Sentry. |
Sorry, something went wrong.
There was a problem hiding this comment.
@WilliamBergamin LGTM! Awaited ack seems so good for tasks needing time 👾 ✨
I left a few comments of thoughts and idea but nothing blocking. Your suggestion of ack_timeout is solid IMHO 👀
Sorry, something went wrong.
| matchers: Optional[Sequence[Callable[..., bool]]] = None, | ||
| middleware: Optional[Sequence[Union[Callable, Middleware]]] = None, | ||
| auto_acknowledge: bool = True, | ||
| acknowledgement_timeout: int = 3, |
There was a problem hiding this comment.
thought: ack_timeout makes sense to me and matches the ack parameter well! 📚 ✨
Sorry, something went wrong.
| assert ( | ||
| f'WARNING On @app.function("{callback_id}"), as `auto_acknowledge` is `True`, `{timeout_argument_name}={kwargs[timeout_argument_name]}` you gave will be unused' | ||
| in caplog.text | ||
| ) |
There was a problem hiding this comment.
quibble: Hardcoding the expected outputs might make this output more immediate at a glance! I'm not so familiar with kwargs I must admit 😔
Sorry, something went wrong.
There was a problem hiding this comment.
I used kwargs in the test in order to assert that the parameter name shown in the warning is the one defined by the function 🤔 I think we should leave it for now but we don't need to make this a common pattern
Sorry, something went wrong.
There was a problem hiding this comment.
@WilliamBergamin LGTM and I'm so optimistic in the change to match ack around- 👾 ✨
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
These changes aim to surface ack_timeout at the function handler level. This allows developers to set their own custom timeout for the acknowledgement, this comes in handler when dealing with dynamic options or new function types that may allow for a timeout greater then 3 seconds
Testing
Set up an app with the following function handler
Bolt will allow your handler to take up to 5 seconds before returning an error response to Slack
Configuring the handler with auto_acknowledge=true (default behavior)
Will print a warning indicating that ack_timeout has no effect
Feedback
Instead of naming this acknowledgement_timeout should e name it ack_timeout? 🟢
Category
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.