question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggested Actions vanish after sending an event

See original GitHub issue

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:

  1. 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
  2. Initialize the bot so the conversation history is displayed including the suggested actions
  3. Send a WEB_CHAT/SEND_EVENT event to the bot using the Redux store dispatch method as in the code above
  4. 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]

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:9
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
compulimcommented, Jun 26, 2019

I think @artemvalmus has the point. Event is designed for non-visual and/or non-interactive activities, e.g. telemetry, idle check, etc. And this is not an intention from user, thus, it should not dismiss suggested actions. I believe this is same for the bot too.

Looking at packages/core/src/sagas/clearSuggestedActionsOnPostActivitySaga.js, this is one of the code that will modify suggested actions (the other one is sagas/incomingActivitySaga.js).

The code will clear suggested actions only if the user is posting an activity of type message. It won’t clear suggested actions if the user is posting an event activity.

On the other side, in sagas/incomingActivitySaga.js, if the bot is sending any type of activities, we will clear the suggested actions.

@artemvalmus can you check if the suggested actions is caused by the bot, instead of the user?

I think it’s fair to update our code to not clearing suggested actions if the last message from the bot is not of type message, because this is not visible to the user.

6reactions
corinagumcommented, Jul 3, 2019

@hhasenauer currently there’s no date associated with this work item. It’s in our Backlog. Customers who are looking for this change should add their +1 here. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

After The Event: 10 Tips For Post-Event Follow-up
Planning the event: From idea to action plan. Organising the event: From action plan to execution. Promoting the event: Spreading the word and...
Read more >
No Rest for #Eventprofs: 8 Essential Things to Do After Your ...
1. Send Thank You's ... Everyone likes to be appreciated. Thank you notes are a great way to acknowledge all the people who...
Read more >
5 things you need to do after the event - Eventtia
If you are looking to receive a few brownie points, it's highly recommended that you send a thank you note immediately after the...
Read more >
suggested actions disappear after click in directline
I have configured directline channel to Microsoft bot framework v4 with node js. I have suggested actions in welcome message.
Read more >
Disappearing prospects: Why they ghost you... and what to do
Here's how to avoid getting ghosted in agency sales, as they disappear into The Abyss. ... Why did they “ghost” you after you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found