Rasa version: rasa==1.0.1
Python version: Python 3.6.7
Operating system (windows, osx, ...):
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
Issue:
The desktop notification for slack always display as "This content can't be displayed." even if the bot response is a valid response. The slack displays the response correctly, but the desktop notification only showing wrong content.
Please let me know, if you need more details
Is this for text messages or any sort of attachments like buttons or images?
No @erohmensing. The issue is appearing even for plain text. No attachments/buttons with the text.
This is interesting because most blocks in slack have an alt_text field where you can put information about what goes in notifications when it can't be shown. Section blocks with only text don't have this field, so one would think the message would show up in the notification. Thanks for pointing it out, i'll look into a fix.
I am also seeing this same message on desktop and iOS notifications. The actual message is delivered correctly into the corresponding Slack channel, just the notifications have stopped working. I restored my notification script to a known good backup and the notification error message persists.
Yeah @factech, it unfortunately is a slack thing.

My fix will turn regular text messages back from blocks into just plain messages, so it'll fix it for regular messages. However for image attachments and such, it's not something we can get around until slack fixes it unfortunately -- we don't want to revert from blocks back to regular attachments since they're legacy and not recommended for further use.
Thanks @erohmensing - I also posted here: https://stackoverflow.com/questions/56317962
Can you confirm this is the same issue? It does seem to be a Slack problem as far as I can tell.
Hmm that's strange, it does seem like from what you mentioned that the text should be used in the notifications. However as @anoop2503 mentioned and I was able to reproduce locally, if you send just a section block with text in it, that's not the case.
If the same thing is happening for you with straight curl requests, no rasa involved, I think you're right, I think they have a bug where their limitations seem to extend to notifications too. Hopefully someone from Slack will notice/respond to your SO post.
It seems there is some confusion with the documentation. The "text" property for notifications needs to be outside of the blocks. Please see the SO post for the fix. Thanks for your help.
Ah, awesome, thank you for _your_ help!
Wait so how do you get rid of the notification itself?
I am having the same problem.... the message shows up fine in slack but the notification says Can't be displayed or something like that. What's the fix? Thanks.
As described in this thread, not fixable for anything other than text, this is a slack issue
My fix will turn regular text messages back from blocks into just plain messages, so it'll fix it for regular messages. However for image attachments and such, it's not something we can get around until slack fixes it unfortunately -- we don't want to revert from blocks back to regular attachments since they're legacy and not recommended for further use.
Hey, i'm not sure how elegant this solution is, but in case you're using rich message formatting such as blocks and attachments, those cause the issue of the notification which cannot display the contents. You can set the message plain text parameter and this will be shown in the notification body.
My use case:
I was writing a python code for my slack App and i found out that when you try to enter plain text along with blocks and/or attachments, the plain text is not visible in the message body when you open the slack app (although in my last test run it seemed to work so i'm not sure about the consistency of this "issue") but i found out while testing the notification view that the plain text is the visible element in the notification. So i set the message up in two ways, the notification text which in our case contains a build number and a status of the build - this is set in the plain text component of the message; and the rest of the message is formatted using attachments - those no longer affect the notification view.
I started having this issue today. Had to change my definition of a struct to eliminate a "invalid_blocks" return -- but now I quickly see the "This context can't be displayed." when the message posts.
type SlackPayloadStruct struct {
//Text string `json:"text"` // this does not work any more
Blocks []SlackBlockStruct `json:"blocks,omitempty"`
}
Edit: The issue was actually the 3001 character limit. When I reduced the size of my block then the "Text" property started working again. However, the Slack Block Kit Builder webpage says "invalid additional property: text" for it.
Most helpful comment
It seems there is some confusion with the documentation. The "text" property for notifications needs to be outside of the blocks. Please see the SO post for the fix. Thanks for your help.