Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1131 A class with async "__call__" method fails to work as a middleware #1132

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

seratch
Copy link
Member

@seratch seratch commented Aug 21, 2024

This pull request resolves #1131

Category (place an x in each of the [ ])

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter
  • Document pages under /docs
  • Others

Requirements (place an x in 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.

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run ./scripts/install_all_and_run_tests.sh after making the changes.

@seratch seratch added bug Something isn't working area:async labels Aug 21, 2024
@seratch seratch added this to the 1.20.1 milestone Aug 21, 2024
@seratch seratch self-assigned this Aug 21, 2024
@seratch seratch mentioned this pull request Aug 21, 2024
8 tasks
@seratch seratch force-pushed the issue-1131-async-callable branch from b01d784 to 5cf5551 Compare August 21, 2024 07:30
Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.00%. Comparing base (40f6d1e) to head (5cf5551).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1132   +/-   ##
=======================================
  Coverage   92.00%   92.00%           
=======================================
  Files         195      195           
  Lines        6605     6606    +1     
=======================================
+ Hits         6077     6078    +1     
  Misses        528      528           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@WilliamBergamin WilliamBergamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 💯 elegant solution

@@ -88,3 +88,9 @@ def get_name_for_callable(func: Callable) -> str:

def get_arg_names_of_callable(func: Callable) -> List[str]:
return inspect.getfullargspec(inspect.unwrap(func)).args


def is_coroutine_function(func: Optional[Any]) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I may rename is_coroutine_function to is_callable_coroutine in a follow up PR

@WilliamBergamin WilliamBergamin merged commit ccbb541 into slackapi:main Aug 21, 2024
12 checks passed
@seratch seratch deleted the issue-1131-async-callable branch October 10, 2024 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:async bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A class with async "__call__" method fails to work as a middleware
2 participants