fix: allow all web api client option types in app initialization#2501
fix: allow all web api client option types in app initialization#2501
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2501 +/- ##
=======================================
Coverage 92.96% 92.97%
=======================================
Files 36 36
Lines 7437 7442 +5
Branches 649 649
=======================================
+ Hits 6914 6919 +5
Misses 518 518
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
hello-ashleyintech
left a comment
There was a problem hiding this comment.
this looks great! thank you ✨
| logLevel?: LogLevel; | ||
| ignoreSelf?: boolean; | ||
| clientOptions?: Pick<WebClientOptions, 'slackApiUrl'>; | ||
| /** |
WilliamBergamin
left a comment
There was a problem hiding this comment.
Directly surfacing the WebClientOptions type in bolt-js feel a bit heavy handed 🤔
It may back us up into a corner where a breaking change in the WebClient results in a breaking change in Bolt, I may be over thinking this but it may be a good idea to add an interface layer
Didn't get much time to think this through fully these are just my initial thoughts
|
@hello-ashleyintech @WilliamBergamin Thank y'all both for reviewing this PR!
What a good callout. I do agree that this exposes The big advantage IMO is that these types should correctly match the installed TBH it's not so clear if types should match preferred or desired behavior though, since without |
|
I am finding these options work in additional cases such as setting const app = new App({
token: process.env.SLACK_BOT_TOKEN,
socketMode: true,
appToken: process.env.SLACK_APP_TOKEN,
logLevel: LogLevel.DEBUG,
clientOptions: {
retryConfig: {
retries: 0,
},
},
});I'll merge this for the next release to match the |
|
@hello-ashleyintech @WilliamBergamin Thank y'all so much for thoughts and reviews 👾 After having considered how upstream changes of |
Summary
This PR exposes all options of
WebClientto theAppconstructor since these values can be customized for behaviors that might be specific to calls of the Slack Web API methods. Perhaps for a customloggeror other added options.Fixes #2484.
Preview
With
typescriptsetups the following will now check without errors:Notes
All provided options are shared when the
WebClientis constructed:bolt-js/src/App.ts
Lines 336 to 353 in 20a5997
Requirements