microsoft / microsoft/BotFramework-WebChat
Suggested Actions vanish after sending an event
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 1.8k
- Forks
- 1.6k
- Avg merge
- 22h 58m
- Merged PRs (30d)
- 2
Description
Version
"botframework-webchat": "^4.3.0"
Describe the bug
After sending an event to the bot the suggested actions from the previous conversation, loaded from DirectLine using the conversation ID and WebChat token, disappear. So all the chat history is loaded, including the last suggested actions. But when I send a WEB_CHAT/SEND_EVENT activity to the bot the buttons vanish. This behavior is clear with sending a user message, but is there a point in hiding them after the event which may not be connected with the user actions?
The event is sent as follows:
const store = createStore(
{},
({ dispatch }: any) => (next: any) => (action: any) => {
if (action.type === 'DIRECT_LINE/CONNECT_FULFILLED') {
setTimeout(() => {
const jobId = getJobIdFromRoute();
dispatch({
payload: {
name: 'webchat/jobcontext',
value: {
gdprAccepted,
jobId: jobId ? jobId : 0
}
},
type: 'WEB_CHAT/SEND_EVENT'
});
}, 1000);
} else if (action.type === 'DIRECT_LINE/INCOMING_ACTIVITY') {
if (action.payload.activity.from.role === 'bot') {
this.setState(() => ({ newMessage: true }));
}
}
return next(action);
});
To Reproduce
Steps to reproduce the behavior:
- Retrieve an existing conversation using the ID and the WebChat token as described here - https://github.com/microsoft/BotFramework-WebChat/issues/2116#issuecomment-505177342. Make sure the conversation has suggested actions in the last activity
- Initialize the bot so the conversation history is displayed including the suggested actions
- Send a WEB_CHAT/SEND_EVENT event to the bot using the Redux store dispatch method as in the code above
- See error - the suggested actions disappear
Expected behavior
Suggested actions from the previous conversation, loaded from DirectLine using the conversation ID and WebChat token, are displayed after sending a WEB_CHAT/SEND_EVENT activity to the bot.
[Bug]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by loading an existing conversation with suggested actions, then dispatching the documented WEB_CHAT/SEND_EVENT action through the Redux store. Trace how the event affects the displayed conversation history and suggested actions; done means the previous suggested actions remain visible after the event is sent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100