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

signingSecret overrides custom receiver #235

Closed
5 of 9 tasks
deslee opened this issue Aug 10, 2019 · 1 comment
Closed
5 of 9 tasks

signingSecret overrides custom receiver #235

deslee opened this issue Aug 10, 2019 · 1 comment
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented

Comments

@deslee
Copy link

deslee commented Aug 10, 2019

Description

Hi! I'm new to using Bolt and Slack in general.
Been scratching my head over why my custom receiver was not working, and when I looked at the source code in src/App.tsx I noticed this:

if (signingSecret !== undefined) {
      this.receiver = new ExpressReceiver({ signingSecret, endpoints });	      this.receiver = new ExpressReceiver({ signingSecret, logger, endpoints });
    } else if (receiver === undefined) {	    } 

So I commented out the SigningSecret that I was previously passing and it worked!

I think the application should either not overwrite the passed receiver, or log a warning in this scenario.

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

  • bug
  • enhancement (feature request)
  • question
  • documentation 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: 1.2.0

node version: 12.6.0

OS version(s): Windows 10 Pro

Steps to reproduce:

  1. Create a custom receiver class
  2. Instantiate an App with a custom receiver and signing key
  3. Emit an event with the receiver

Expected result:

Bolt doesn't overwrite my receiver with the ExpressReceiver

Actual result:

Bolt overwrites my receiver with the ExpressReceiver

Attachments:

https://github.com/slackapi/bolt/blob/522e70b381cf3d18a88b7ca271dcfb4f0ce1be9b/src/App.ts#L161

@shaydewael
Copy link
Contributor

I definitely agree that Bolt shouldn't override the passed in receiver. This seems like a bug to me as the constructor should be checking if signingSecret is defined and receiver is undefined

@shaydewael shaydewael added the bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented label Aug 19, 2019
@shaydewael shaydewael mentioned this issue Oct 1, 2019
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented
Projects
None yet
Development

No branches or pull requests

2 participants