Proactive Message Delay in Client
See original GitHub issueThis is a bit of an overlapping issue between Sdk / Composer / Client, however posting it here.
I have developed an handoff integration with Genesys that is built around a websocket that calls ContinueConversationAsync when a new message arrives from the agent :
private async Task SendActivity(string eventName, string text = null, object data = null)
{
await DialogContext.Context.Adapter.ContinueConversationAsync(_claimsIdentity, _conversationReference, new BotCallbackHandler(async (turnContext, cancellationToken) =>
{
turnContext.Activity.Type = ActivityTypes.Event;
turnContext.Activity.Name = eventName;
turnContext.Activity.Text = text;
turnContext.Activity.Value = data;
await _callbackHandler(turnContext, cancellationToken);
}), default);
}
This is then picked up in Composer and send to the user:
The speed at which the message arrives at the client (emulator in this scenario) is within a second. However before it is actually displayed another 6 seconds pass.
So in the screenshot below the yellow marked “ola” arrives almost instantaneously but 6 seconds pass before it is displayed in the chat itself.
What is causing this?
Issue Analytics
- State:
- Created 2 years ago
- Comments:19 (1 by maintainers)
Top Results From Across the Web
Recipe: Delay your proactive messages to give customers a ...
Another solution is to delay all your proactive messages. This gives visitors the opportunity to notice the chat option, and manually request a ......
Read more >Send proactive messages - Teams | Microsoft Learn
A proactive message is any message sent by a bot that isn't in response to a request from a user. This message can...
Read more >5 Ways to Navigate Shipping Delays with Proactive Customer ...
5 Ways to Navigate Shipping Delays with Proactive Customer Service · 1. Be upfront and honest. · 2. Address the issue before it...
Read more >How to Communicate Delivery Delays: 7 Excellent Email ...
B. Proactive notifications regarding stalled shipments ... Delays happen. When they do, it's best to alert the customer you're aware of the issue...
Read more >Provide Help Before It's Needed With Proactive Support
Why proactive support is your first line of defense 1 min; Preemptively identify recurring customer issues 3 min; 4 proactive messages to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In the botbuilder-dotnet source within ActivityEx.cs:535 it sets the replyToId to the value contained in Activity.Id of the turnContext. I’m not sure if there is a valid reason to ever do this on a proactive message.
However I was able to find a workaround. When sending the proactive message you can null Activity.Id and the framework will end up passing null in the replyToId field, which then eliminates the queueing delay in the webchat client
Just wanted to chime in and say I’m also experiencing this issue using webchat/directline. We’re using proactive messages for handoff and inactivity prompts.
Here’s the websocket messages from a conversation resumed from the directline cache in case it’s of any help. The bottom two are the delayed proactive messages. They are recieved at the same time as other messages but have a delay before being shown in UI.
Could the issue be related to the activity
replyToId
? The value set on proactive messages does not match any in the conversation. Prehaps webchat is waiting to find the matching ID before showing the message?