Repository navigation
Fix #370 by adding an alias of next arg (next_) in middleware arguments - #394
Conversation
seratch
left a comment
There was a problem hiding this comment.
comments for reviewers
| assert response.body == "acknowledged!" | ||
| assert_auth_test_count(self, 1) | ||
|
|
||
| def test_decorator_next_call(self): |
There was a problem hiding this comment.
Checking these test patterns should be helpful for knowing the purpose of the changes.
| middleware_state = {"next_called": False} | ||
|
|
||
| def next(): | ||
| def next_(): |
There was a problem hiding this comment.
This is not an essential part of this PR. It's just a minor refactoring
| "respond": request.context.respond, | ||
| # middleware | ||
| "next": next_func, | ||
| "next_": next_func, # for the middleware using Python's built-in `next()` function |
There was a problem hiding this comment.
Adding this enables bolt-python to resolve the alias name as well.
Codecov Report
@@ Coverage Diff @@
## main #394 +/- ##
=======================================
Coverage 91.60% 91.61%
=======================================
Files 167 167
Lines 5384 5388 +4
=======================================
+ Hits 4932 4936 +4
Misses 452 452
Continue to review full report at Codecov.
|
mwbrooks
left a comment
There was a problem hiding this comment.
Looks good to me! ✅
Just out of curiosity, is next_ a convention in Python? Rather than say nextMiddleware.
I think |
This pull request fixes #370. The essential change in this pull request is to add
next_to kwargs_injection names. With this fix, developers can usenext_in addition tonextin the middleware method arguments.Category (place an
xin each of the[ ])slack_bolt.Appand/or its core componentsslack_bolt.async_app.AsyncAppand/or its core componentsslack_bolt.adapter/docsRequirements (place an
xin each[ ])Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
./scripts/install_all_and_run_tests.shafter making the changes.