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

passed clientOptions and authorizationUrl to @slack/oauth #586

Merged
merged 2 commits into from
Aug 21, 2020

Conversation

stevengill
Copy link
Member

Summary

passed clientOptions and authorizationUrl to @slack/oauth.

Exported interfaces from @slack/oauth and everything from @slack/types.

Added npm run watch command that uses nodemon to rebuild the source on every change.

Issue: #585

Requirements (place an x in each [ ])

@stevengill stevengill added the enhancement M-T: A feature request for new functionality label Aug 19, 2020
@stevengill stevengill self-assigned this Aug 19, 2020
@stevengill
Copy link
Member Author

This needs slackapi/node-slack-sdk#1081 to be merged and released first

Copy link
Contributor

@misscoded misscoded left a comment

Choose a reason for hiding this comment

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

LGTM, single question for own understanding

@@ -104,6 +106,8 @@ export default class ExpressReceiver implements Receiver {
installationStore,
stateStore: installerOptions.stateStore,
authVersion: installerOptions.authVersion!,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is installerOptions.authVersion the only one to get the non-null assertion? ie, stateStore also defaults

Copy link
Member Author

Choose a reason for hiding this comment

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

lol the short answer is that the editor yelled at me and i wanted it to stop.

The real answer is that the type of installerOptions.authVersion can only be 'v1' | 'v2' and in this line, it could potentially be undefined. Even if it is undefined here, once it makes it to @slack/oauth, it will get the default value of v2 assigned if that is the case.

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 to me as long as tests pass after we merge slackapi/node-slack-sdk#1081

@@ -166,6 +166,8 @@ export default class App {

private axios: AxiosInstance;

private installerOptions: ExpressReceiverOptions['installerOptions'];
Copy link
Contributor

Choose a reason for hiding this comment

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

since installerOptions is just passed through to the ExpressReceiver, can we avoid storing it as a property in App?

just picked up on the code smell of a property's type being defined in terms of another class's property.

Copy link
Member Author

Choose a reason for hiding this comment

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

The reason why I store it as a property is because I have to add clientOptions to installerOptions. You can see that at https://github.com/slackapi/bolt-js/pull/586/files#diff-0286657a0789ea9446fa3de979ff3e09R226-R229.

src/ExpressReceiver.ts Outdated Show resolved Hide resolved
src/ExpressReceiver.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 20, 2020

Codecov Report

Merging #586 into main will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #586      +/-   ##
==========================================
+ Coverage   83.24%   83.27%   +0.02%     
==========================================
  Files           7        7              
  Lines         597      598       +1     
  Branches      193      193              
==========================================
+ Hits          497      498       +1     
  Misses         67       67              
  Partials       33       33              
Impacted Files Coverage Δ
src/App.ts 87.86% <100.00%> (+0.05%) ⬆️
src/ExpressReceiver.ts 64.92% <100.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 ac327a0...982987a. Read the comment docs.

@stevengill stevengill merged commit a168252 into slackapi:main Aug 21, 2020
mashabow added a commit to mashabow/slack-rota that referenced this pull request Sep 24, 2021
slackapi/bolt-js#586

> Exported interfaces from @slack/oauth and everything from @slack/types.
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 semver:minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants