microsoft / botbuilder-js

Welcome to the Bot Framework SDK for JavaScript repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using JavaScript.
https://github.com/Microsoft/botframework
MIT License
685 stars 280 forks source link

Language Generation depending on Microsoft Teams Setup not working properly #4318

Closed saskialorraine closed 2 years ago

saskialorraine commented 2 years ago

Versions

What package version of the SDK are you using. "botbuilder": "4.16.0",

What nodejs version are you using: Node.js v16.14.2.

Describe the bug

Working with Bot Framework Composer & Bot Framework SDK the following issue appears when deploying to Microsoft Teams:

We are using the existing automation for language generation in the SDK, which should allow the user to get the Bot with the language depending on their language setup in Teams.

This kind of works, but there are unpleasant behaviors. The bot seems to struggle initially recognizing the defined language and therefore switches a few times before getting it right. This, as it seems, only appears in the very beginning of the conversation. It seems that the Bot has trouble initializing. Also, this only happened with a few users (like 5 out of 50).

Is there a way to clean this out or does anyone know what may cause this behavior?

Thanks!

To Reproduce

Steps to reproduce the behavior:

  1. Initially letting the bot proactively messaging a user in teams
  2. Witness the issue

Expected behavior

Just messaging in the defined teams language.

Screenshots

Those are two screenshots from different users:

image image

dmvtech commented 2 years ago

Hi @saskialorraine

I am unaware of this behavior, but it is very interesting for sure.

This bot was built in Composer, correct? And you are using the Node runtime? Have you tested to see if this behaves the same with a C#/dotnet runtime Composer bot?

saskialorraine commented 2 years ago

Hey @dmvtech, thanks for the answer.

Yes, it was built in Composer. No we didn't test it with C# due to time reasons. That would mean to set it all up again and then deploy it on MS teams..

saskialorraine commented 2 years ago

image

Again a weird switch appeared

saskialorraine commented 2 years ago

image And again.. Just posting this to keep this issue alive

dmvtech commented 2 years ago

Thank you @saskialorraine

Apologies for the delay. I am still investigating. Thank you for the additional information.

dmvtech commented 2 years ago

Hi @saskialorraine

I am not able to reproduce this. Are you able to test or reproduce this with a locally running bot (code) and test from Teams using ngrok?

We need to check what the locale shows for the conversationUpdate activity (in both situations):

{
  "type": "conversationUpdate",
  "membersAdded": [
    {
      "id": "uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu",
      "name": "Bot"
    },
    {
      "id": "bbbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbbb",
      "name": "User"
    }
  ],
  "recipient": {
    "id": "uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu",
    "name": "Bot",
    "role": "bot"
  },
  "from": {
    "id": "bbbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbbb",
    "name": "User",
    "role": "user"
  },
  "locale": "en-us"
}
axelsrz commented 2 years ago

Closing due to inactivity, if problem persist, please re-open or create a new issue.