slackapi / node-slack-interactive-messages

Slack Buttons, Menus, and Dialogs made simpler for Node
MIT License
133 stars 41 forks source link

Make respond() function wait until next tick before sending request #69

Closed aoberoi closed 5 years ago

aoberoi commented 6 years ago

Description

Inspired by #68.

Users of this package have the ability to call respond() inside a handler before the handler function has returned. That means that someone may accidentally try updating an interactive message before the interactive message has even been acknowledged (because the handler returning is the signal that we can respond with 200 OK). If the respond() function waited until the next tick to do any work, then the handler function's return would always be before the request to the response_url, and it would prevent these types of issues.

Disclaimer: we're still not sure this was the actual problem with the issue mentioned above.

Requirements

shaydewael commented 5 years ago

https://github.com/slackapi/node-slack-sdk/issues/826