12

I am building a slack app connected with a Symfony application that uses slash commands and dialogs as UI to create new users, accounts and projects and store them in a database.

I use a slash command to trigger a dialog with input fields and store the submitted data in a database, send a 'user successfully created' message to slack as well as a 200 response with an empty body, as described in the documentation. However, when I fill in the input fields and press submit, I receive an error message with 'We had some trouble connecting. Try again?'. This error also prevents the dialog from closing.

The submitted data is still received correctly by my application and stored to the database and the 'user successfully created'-message is also send correctly to slack. So the whole process seems to work correctly, the only problem is that the dialog doesn't close and shows the error message.

I also tried to immediately send a http 200 response, without processing the submitted data first and this gives the same error message.

  • 1
    Possible duplicate of [Slack dialog doesn't close after form submission](https://stackoverflow.com/questions/48714834/slack-dialog-doesnt-close-after-form-submission) – Erik Kalkoken Apr 16 '19 at 18:39
  • 1
    Thanks for your reply. I already send the 200 response with an empty body. I also tried to send an response with a list of input validation error, but results in the same error. – Tara Van den Eede Apr 17 '19 at 08:20
  • Then please add the relevant part of your code to the question. I think its the only way people will be able to help you find the bug. – Erik Kalkoken Apr 17 '19 at 09:35
  • any update on this? – Nebi M Aydin May 14 '20 at 03:47
  • 1
    @NebiMAydin: Try a 204 response and no body. This helped me solve the problem (using golang). – hanord May 20 '20 at 12:17
  • For those still getting this error, particularly with Flask apps - I found that setting the response mimetype to `''` resolved the issue. – smarcellus Jan 12 '22 at 00:46
  • In django DRF returning a response with `{}` body closed the dialog for me. – MadeOfAir Aug 18 '23 at 09:39

1 Answers1

1

In Golang, the only thing that worked was responding with status 200 and empty body: w.Write(nil).

I am not sure which lang are you using but try responding with an empty body. Responding with 204 did not work for me.

papadoubi
  • 11
  • 1