This repository was archived by the owner on Sep 3, 2025. It is now read-only.
bug(slack/api): Make slack /event respond to challenge #5375
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When configuring event listening for a slack app, your endpoint is required to respond correctly to the slack challenge that is sent. If your endpoint does not respond correctly, slack will not let you use it. Currently, the events endpoint does not respond correctly to the challenge because it is using a background thread to process all incoming events and responding with a static response. In order to use the events endpoint correctly (including using an @ in the incident channel to add an observer), that endpoint has to respond. I altered the event post to check the body for a "url_verification" type (which is how slack does the verification) and, if it exists, process the event synchronously in the same way the
actionsendpoint does. Otherwise, process async like it always has. I don't see any tests for slack endpoints. I can add one. I have deployed this to our own dev environment and verified it manually. I checked the following:/api/v1/<organization>/events/slack/eventendpoint as described in the documentation. This was previously failing@results in them being added to the incident as an observerAs far as I can see, this is the expected behavior of the event listening. I can add more if needed.