Botframework-webchat: first ConversationUpdate sent is not matching with the Emulator - locale problem

Created on 9 Sep 2019  路  7Comments  路  Source: microsoft/BotFramework-WebChat

Version

Based on the _botAgent I'm seeing in my DirectLine object, I'm currently at DirectLine 3.0 and WebChat 4.5.2

Describe the bug

Conversation update is sent without the locale, which then cause the welcome message to be in the default language

To Reproduce

Steps to reproduce the behavior:

  1. Create a React Webchat component
  2. Generate a new token and a new directline object, pass it to ReactWebChat
  3. Your bot didn't get the locale that you set in the ReactWebChat, but the default one set in the bot

Expected behavior

Your bot use the locale sent via ReactWebChat.

For example, if you use the emulator, the activity object that the bot will recieve is the following :
Code_2019-09-09_15-32-17
As you can see the locale is set.

With the ReactWebChat component we get the following :
Inkedpwsh_2019-09-09_15-38-51_LI

Additional context

I add a backline which send an event with the locale as soon as the directline is connected (as per example 15
BUT it did not constantly prove to be working (event coming too late after the conversation update maybe, or the other way around), so I had to add a delay of around 300ms to fix the issue but this is far from being optimal

Bot Services Bug customer-replied-to customer-reported

Most helpful comment

@p-nagpal can you provide any detail to the updated ConversationUpdate mechanism and how it affects locales being provided from Direct Line to the bot in a deployed scenario? The service recently made a change that could have affected this behavior, and we should port this behavior in to the BF Emulator to keep the experience consistent if that is the case, or update documentation if the service has different guidance. @Zack-Strife what you may have run in to here is a difference in behavior between how the BF Emulator "emulates" Direct Line and Direct Line actual.

All 7 comments

The Direct Line Connector Service is responsible for sending the conversation update event to the bot when the conversation is established, and I don't believe the service would be able to detect the user's locale and set it appropriately in the event.

I would recommend sending a backchannel welcome event when the Direct Line Connection is fulfilled and sending the welcome message from the event handler instead of the on members added handler if you want to localize the welcome message. I would recommend looking at Backchannel Welcome Event Web Chat sample which you seemed to have already found.

@compulim, thoughts?

@p-nagpal can you provide any detail to the updated ConversationUpdate mechanism and how it affects locales being provided from Direct Line to the bot in a deployed scenario? The service recently made a change that could have affected this behavior, and we should port this behavior in to the BF Emulator to keep the experience consistent if that is the case, or update documentation if the service has different guidance. @Zack-Strife what you may have run in to here is a difference in behavior between how the BF Emulator "emulates" Direct Line and Direct Line actual.

@Zack-Strife we are discussing this internally, we'll come back with a relevant update shortly. Thanks for your patience!

Hello @Zack-Strife. Thank you for your patience. The DirectLine channel service does not provide locale information in the ConversationUpdate messages that are sent outside of the Emulator.

Can we get some additional data from you?

  1. In which scenario are you hoping to use the locale provided in the ConversationUpdate message? Are you able to get this locale information via other activites? For example, the Message activity will always contain a user's locale.

  2. How are you integrating WebChat in your deployed environment? Are you using the self-hosted React package or the embed link provided by the Azure Bot Service?

Thank you!

@Zack-Strife if you can help us understand the question above, that'll be very helpful.

@Zack-Strife we will close this for now for inactivity. Please create a new issue referencing this one for continuation.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Stardox picture Stardox  路  3Comments

adriantan08 picture adriantan08  路  3Comments

vikramdadwal picture vikramdadwal  路  3Comments

GewoonMaarten picture GewoonMaarten  路  3Comments

filipjakov picture filipjakov  路  4Comments