Bolt-js: What's the current status with Bolt on handling event acknowledgements with Faas (Firebase Cloud Functions)?

Created on 2 Dec 2020  路  2Comments  路  Source: slackapi/bolt-js

Description

What's the current status with Bolt on handling event acknowledgements with Faas (Firebase Cloud Functions)? I contacted Slack support and was recommended these threads which I read, but they didn't seem to be fully up to date.

https://github.com/slackapi/bolt-js/issues/361
https://github.com/slackapi/bolt-js/issues/395
https://github.com/slackapi/bolt-js/issues/329

We're having the issue where we're getting some events sent to us three times, like a user adding a reaction in a channel, because it takes our function some time to spin up when it hasn't been active for a bit. That's really the only problem we've experienced with our FaaS so far. What's currently your recommendation on handling this? In other cases, we're acknowledging immediately and then handling the logic afterwards. If there's a way for us to use manual ack() for events as well, that'd be great. Thanks!

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

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

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

  • [X] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [X] I've read and agree to the Code of Conduct.
  • [X] I've searched for any related issues and avoided creating a duplicate issue.
question

Most helpful comment

Hi @seratch, thanks a ton for the quick response! All right, then we'll probably solve it as you described with two functions. That should work. Thanks again, love using Bolt! :)

All 2 comments

Hello @GuineaPigApp thanks for taking the time to write in here!

What's currently your recommendation on handling this? In other cases, we're acknowledging immediately and then handling the logic afterwards. If there's a way for us to use manual ack() for events as well, that'd be great. Thanks!

We don't have any updates after the issue #361. As I mentioned in the issue, the safest way is to have two functions:

  • 1) internet-facing function, which does ack() to the Slack API server and enqueues the payload for an internal async function (or directly invoking another function works).
  • 2) async function, which can do anything apart from ack()

In Bolt for Python, we've implemented a useful feature for easily invoking another functions using the same function (Google Cloud Functions is not yet supported, though) but we don't have plans to implement the similar in Bolt for JS in the short term. https://slack.dev/bolt-python/concepts#lazy-listeners

As I mentioned in #361, automatic ack() does not work as long as your app runs on FaaS environments.

Hi @seratch, thanks a ton for the quick response! All right, then we'll probably solve it as you described with two functions. That should work. Thanks again, love using Bolt! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jacklein picture jacklein  路  4Comments

TK95 picture TK95  路  3Comments

i-break-codes picture i-break-codes  路  4Comments

dginovker picture dginovker  路  4Comments

selfcontained picture selfcontained  路  4Comments