My Dialogflow sessions seem to change by whether I manually type in text or click on a button. My backend function generates the buttons in a payload for slack that is displayed in Dialogflow.
The buttons show properly and work as expected except when I need something from the output contexts and existing session. The problem seems to be that when I am manually entering text in Slack, it is one session and when I click on a button, it is another session. I don't know why that would be the case, but I obviously want them to be treated as one session.
I created a simple intent and webhook call which simply returns the current session ID when called. I created a "what session" intent. I created a "what session" button with a value of "what session". When I type "what session" (or "which session"), the session comes back as a certain session with the buttons as expected. When I click on the "what session" button, I get the same result EXCEPT it is a DIFFERENT session. Every time I click on the button, I am in one session and when I manually type in "what session" again, I get the original session.
In the history, you can see two different conversation streams.
So, how do I have the buttons, when clicked, keep the user in the same session?
Here is the format for the buttons (pretty straight forward). The backend function also populates the "text" field with the session value, but doesn't change anything else.
{
"slack": {
"text": "",
"attachments": [
{
"blocks": [
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "test"
},
"value": "test"
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "what session"
},
"value": "what session"
}
]
}
]
}
]
}
}
Here is what the interaction looks like on slack (on mobile):
Here is the history in Dialogflow showing the two separate streams:
Google support helped me on this - thank you! The solution was to add the Request URL into the Interactivity & Shortcuts section.
Now, imagine my embarrassment when I reread the last step in the instructions to do exactly this:
"To use rich messages, copy the ‘Events Request URL' value below and paste it into the 'Request URL' field from the Interactive Messages section of your Slack app settings."
HOWEVER, in my defense, I wondered how I had missed this twice (since I set up everything again for testing to see what I was missing). I know I would have done this. The weird thing was that when I completed the step in Slack, I realized that my changes were not being saved on that page. I clicked on the "Save Changes" and assumed it had saved, but the button had not turned green so the changes had not been saved. So, my advice to anyone experiencing the issue above is to ensure that all their changes were saved in Slack.