-
Notifications
You must be signed in to change notification settings - Fork 399
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
Custom receiver not respected when when using Socket Mode #834
Comments
Hey @johnboxall, it's good to hear from you 👋🏻 This is a use-case that we overlooked while designing the first release of I believe @stevengill is going to weigh-in on this in a bit, so I'll leave it to him to start the discussion! |
Hey @johnboxall! Glad to see you are using Bolt!
This is a great idea. SocketMode is a receiver in BoltJS. So you aredefinitelyy trying to use 2 receivers which isn't allowed and we should throw an error for this.
This isn't possible today. In |
@stevengill We at Salesforce are also seeing this limitation as well. I think this would be a great feature as it would be nice to use socket mode to develop locally and handle custom express routes as it's a requirement for my use case. Was pointed to search this repo as this was a question a brought up during an internal Slack session with Bear Douglas. What would be the alternative? Would we have to use the node slack sdk directly (@slack/socket-mode, @slack/web-api, @slack/events-api) and set up express manually? |
Hey @lranches-sfdo, Yeah I definitely see the value in custom routes. Especially for this usecase of using socketMode for development but still support some custom routes. I've created an issue to specifically track this issue over at #866 An alternative would be to use those libraries, but it is a good amount of work to setup. Also |
I am having another common usecase i.e, custom routes in app will be used for health checks in load balancer.But Socketmode doesn't support this right now. |
Hi friends, I have a use case that's likely very similar to others' -- I want to use socket mode, but need to expose some custom routes ( This worked for me; sharing here in case it helps someone else. Create receiver: const receiver = new ExpressReceiver({
signingSecret: process.env.SLACK_SIGNING_SECRET
}); Create app: const app = new App({
token: process.env.SLACK_BOT_TOKEN,
signingSecret: process.env.SLACK_SIGNING_SECRET,
socketMode: true,
appToken: process.env.SLACK_APP_TOKEN
}); Note that I did not pass the receiver into the app. Now just start them independently: await app.start(PORT);
await receiver.start(PORT); ¯\(ツ)/¯ This feels hacky, so I'm still +1'ing the original issue. In the interim, though, hope this is useful to someone! |
Thanks again for sharing the feedback here! So, going back to the original topic in this issue:
I just created a new ticket for this task: #1068 We'll track the progress of this task there instead.
We have a ticket issue #866 resolving this. @misscoded will be working on this soon. |
Support for custom HTTP routes has been introduced and will be available with the release of 3.7.0. 🙂 With #1068 and #866 now both resolved, we're going to close this issue. Thank you to all those that participated, from upvoting to providing details around use cases! 🙏🏼 |
Description
Hey friends,
I'm working on a Bolt app which uses the Adding Custom HTTP routes feature:
I'm personally using this feature to serve a OAuth login flow over HTTP that works together with the Slack app to log folks into another service.
Recently, I became aware of Socket Mode, which is helpful in working around having a public webhook in my development environment.
Enabling
socketMode
in theApp
quietly discards my customreceiver
.My request is two part-er:
App
raised an error if you setsocketMode
and pass a customerreceiver
if the behaviour is to discard thereceiver
.socketMode
and b) add custom HTTP routesWhat type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Steps to reproduce:
socketMode
on your appExpected result:
The custom HTTP routes are accessible.
Actual result:
The custom HTTP routes are NOT accessible.
ps. Bolt was very straight forward to get started with and
socketMode
seems quite innovative and awesome! Thanks for your hard work on this. ❤️ ❤️ ❤️The text was updated successfully, but these errors were encountered: