Skip to content

Conversation

WilliamBergamin
Copy link
Contributor

@WilliamBergamin WilliamBergamin commented Oct 9, 2025

Summary

These changes allow to easily determine if fail or complete was invoked, invoking both in the same handler can sometimes lead to errors returned from the Slack API

Testing

try:
    # do some things to create the step output
    
    complete(outputs={"search_result": invalid_object}) # this could cause a parameter validation error from the Slack API
except Exception as e:
    logger.error("Unexpected error occurred")
    if not complete.has_been_called():
        fail(error="internal error")

The same applies to the fail utility function 🙏

Category

  • 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

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.

Copy link

codecov bot commented Oct 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.05%. Comparing base (1d4e86b) to head (c970416).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1390      +/-   ##
==========================================
+ Coverage   91.03%   91.05%   +0.02%     
==========================================
  Files         222      222              
  Lines        7514     7534      +20     
==========================================
+ Hits         6840     6860      +20     
  Misses        674      674              

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

Copy link

@cchensh cchensh left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

@WilliamBergamin LGTM! This is quite slick I admit 🚢 💨

@zimeg zimeg added this to the 1.27.0 milestone Oct 10, 2025
@WilliamBergamin WilliamBergamin merged commit c8a50be into main Oct 10, 2025
14 checks passed
@WilliamBergamin WilliamBergamin deleted the function-utility-has-been-called branch October 10, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants