0

The set-up:

We built a slack service that quickly posts a slack slash command payload to AWS (slack slash command request URL hits AWS API Gateway). API Gateway quickly responds to Slack (within 3 seconds). We use the slack payload (channel_id, response_url, etc) to axios post back to slack. This all works. In fact, we have multiple slack 'bots' so the incoming request determines which Lambda function to hit and caters the response to slack accordingly. We are not using slack bolt, we are not using the slack sdk. We are using node.

The problem:

Some of our slack bots will require a modal. We attempted to post to https://slack.com/api/views.open but by the time AWS APIGW -> Lambda -> posts to views.open, our trigger_id has expired (3 seconds is up) most of the time. Since we don't always need a modal, posting to views.open every time to acquire a view_id to display a modal further down the stream might be the only way, but doesn't seem efficient.

Any ideas on how to use modals, posting to views.open, without the slack sdk and without trigger_id expiring?

Thanks!

dmongit
  • 33
  • 1
  • 6
  • We have a similar problem albeit slightly different. I have created a button that, when pressed, retrieves data from a mongodb collection and returns a subset of the data to the slack user via a modal view. When the lambda is warm, it works ok but cold start, we see trigger id expiration. Now I know I can provision concurrency to alleviate the cold start but this isn’t ideal, especially when the mongo collection will likely grow and that db retrieval time will only add to the problem. Did you come up with a nice solution? – user1495536 Jun 11 '23 at 08:38
  • No, but I also don't work at the place I need to solve that any more. It has been a year since I've looked. Have there been any updates to the slack sdk to help? – dmongit Jun 12 '23 at 11:01
  • I ended up getting around it by returning an empty view modal to slack straight away and then using the viewid in the response to update to the content I want. – user1495536 Jun 15 '23 at 08:23

0 Answers0