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

Redundant code path inside an if/else block in App class #1231

Closed
4 of 10 tasks
TEMHITHORPHE opened this issue Dec 3, 2021 · 2 comments · Fixed by #1327
Closed
4 of 10 tasks

Redundant code path inside an if/else block in App class #1231

TEMHITHORPHE opened this issue Dec 3, 2021 · 2 comments · Fixed by #1327
Labels
enhancement M-T: A feature request for new functionality
Milestone

Comments

@TEMHITHORPHE
Copy link

Description

Describe your issue here.

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • example code related
  • testing related
  • discussion

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

  • 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 searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

package version:@slack/bolt@3.8.1

node version:14.17.5

OS version(s):Win32

Steps to reproduce:

  1. Just open the source code file and see. ( … /node_modules/@slack/bolt/dist/App.js:404)

Expected result:

Take a different code path, i.e. call a different function if ELSE block executed

Actual result:

weird

Attachments:

Logs, screenshots, screencast, sample project, funny gif, etc.

@seratch seratch added this to the 3.9.0 milestone Dec 3, 2021
@seratch seratch added the enhancement M-T: A feature request for new functionality label Dec 3, 2021
@seratch
Copy link
Member

seratch commented Dec 3, 2021

@TEMHITHORPHE Thanks for taking the time to report this!

The TypeScript code has a slight difference but it does not make any runtime benefit: https://github.com/slackapi/bolt-js/blob/%40slack/bolt%403.8.1/src/App.ts#L784-L790

Indeed, the lines of code are just redundant. We can simplify the code in future versions.

@TEMHITHORPHE
Copy link
Author

TEMHITHORPHE commented Dec 7, 2021

@seratch

Okay, but I sure hope "redundant" is only what it is, cause I had to dig into source when I was getting a funny "slack_bot_authorization_error" on a recent(and first) AWS Lambda deployment days ago, brought the entire project to a standstill, and am currently just starting again from scratch, following the steps from https://slack.dev/bolt-js/deployments/aws-lambda like a baby, in case I missed any steps during my previous deployment. Needless to say that too just hit a snag, because for whatever reason I don't understand, "serverless-offline" is not responding to SLACK 's Event API's challenge, but that's an "issue" for another day.

@seratch seratch changed the title Redundant Code Path Inside IF ELSE bLock Redundant code path inside an if/else block Dec 29, 2021
@seratch seratch modified the milestones: 3.9.0, 3.x Dec 29, 2021
@seratch seratch changed the title Redundant code path inside an if/else block Redundant code path inside an if/else block in App class Feb 23, 2022
seratch added a commit to seratch/bolt-js that referenced this issue Feb 23, 2022
@seratch seratch modified the milestones: 3.x, 3.10.0 Feb 23, 2022
srajiang added a commit that referenced this issue Feb 23, 2022
…1327)

Co-authored-by: Sarah Jiang <sarahjiang@slack-corp.com>
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants