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 #719 Enable developers to customize the way to handle unmatched requests #741

Merged
merged 1 commit into from
May 10, 2021

Conversation

seratch
Copy link
Member

@seratch seratch commented May 10, 2021

This pull request resolves #719 by adding new option named unmatchedRequestHandler in AppConfig.

App app = new App(AppConfig.builder()
  .unmatchedRequestHandler((req) -> Response.builder().statusCode(400).build())
  .build());

Also, I've added code snippet suggestion in the unmatched pattern warning logs like we did in Python slackapi/bolt-python#323

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

  • bolt (Bolt for Java)
  • bolt-{sub modules} (Bolt for Java - optional modules)
  • slack-api-client (Slack API Clients)
  • slack-api-model (Slack API Data Models)
  • slack-api-*-kotlin-extension (Kotlin Extensions for Slack API Clients)
  • slack-app-backend (The primitive layer of Bolt for Java)

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to the those rules.

@seratch seratch added enhancement M-T: A feature request for new functionality project:bolt labels May 10, 2021
@seratch seratch added this to the 1.8.0 milestone May 10, 2021
@seratch seratch self-assigned this May 10, 2021
@codecov
Copy link

codecov bot commented May 10, 2021

Codecov Report

Merging #741 (3e0f899) into main (2ab39d0) will increase coverage by 0.07%.
The diff coverage is 93.93%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #741      +/-   ##
============================================
+ Coverage     77.29%   77.37%   +0.07%     
- Complexity     3283     3302      +19     
============================================
  Files           368      370       +2     
  Lines          9721     9771      +50     
  Branches        928      933       +5     
============================================
+ Hits           7514     7560      +46     
- Misses         1657     1659       +2     
- Partials        550      552       +2     
Impacted Files Coverage Δ Complexity Δ
...lt/src/main/java/com/slack/api/bolt/AppConfig.java 72.34% <ø> (ø) 25.00 <0.00> (ø)
bolt/src/main/java/com/slack/api/bolt/App.java 66.79% <93.75%> (+0.84%) 123.00 <0.00> (ø)
...om/slack/api/bolt/util/ListenerCodeSuggestion.java 93.75% <93.75%> (ø) 17.00 <17.00> (?)
...andler/builtin/DefaultUnmatchedRequestHandler.java 100.00% <100.00%> (ø) 2.00 <2.00> (?)
...i/socket_mode/impl/SocketModeClientJavaWSImpl.java 61.22% <0.00%> (-0.69%) 32.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ab39d0...3e0f899. Read the comment docs.

Copy link
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

Looks good! I really like the ListenerCodeSuggestion implementation 👍🏻

@seratch seratch merged commit 416ab04 into slackapi:main May 10, 2021
@seratch seratch deleted the issue-719-unmatched-requests branch May 10, 2021 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality project:bolt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable developers to customize the way to handle unmatched requests
2 participants