BotFramework-Composer icon indicating copy to clipboard operation
BotFramework-Composer copied to clipboard

Overwriting LUIS apps during publish when creating new bots (or reset internal state when creating a new bot or opening an existing bot)

Open yochay opened this issue 7 years ago • 7 comments

Launched composer open interruption sample click 'start bot' --> setup my LUIS app and key info Composer created new LUIS apps (2), as expected. One of the apps InteruptBot1(test)-Main.en-us.lu

Hit the home page create a new bot, called it test bot add LU file hit restart bot --> not that is already a bug, as we dont rest the UI when creating a new bot the published LU file over wrote InteruptBot1(test)-Main

Expected behavior:

  • create a separate sets of LUIS apps per given bot

When creating a new bot or opening an exciting bot, we need to rest UI elements and internal logic:

  • The "Restart bot" button needs to rest to public
  • reset "Test in emulator"
  • reset LUIS values, at least the app name and environment. We can leave the LUIS key in place.

yochay avatar Aug 14 '19 23:08 yochay

When you create a 'new' bot called test, I am guessing you actually have created a test bot before and you have set the environment and name which are the same as that of the interruption sample bot. Otherwise, for our current code base, it will always open the form asking for setting up LUIS app and key info.

For the expected behavior:

  1. We can open the form asking for environment, name and key info. every time we click the 'start bot'/'restart bot' button. Or
  2. We can remove this pop up form. We use the setting page to record the environment, name as well as the key info. What do you think? @yochay @cwhitten @boydc2014

liweitian avatar Aug 15 '19 07:08 liweitian

@liweitian i think the issue is we don't reset some states, like luis app\env, and other stuffs, we don't really need to ask everytime we click start, what we need to do is make the luis config per bot, that's it.

@yochay we can reset some Luis config, like app\env name, but actually the restart/test is by design not reset, and indeed it's not "not reset", it's auto started.

boydc2014 avatar Aug 15 '19 08:08 boydc2014

@boydc2014 I think we need to consider what get reset when we create a new and when we open a new bot, including visual cues and internal state. Can we come up with a list of items?

yochay avatar Aug 15 '19 14:08 yochay

When a new bot is created/opened, we should be clearing out any bot specific credentials (LUIS/OAuth credentials/etc). We should not remove the pop-up asking for information if it does not exist on the current bot.

My expectation in this scenario would be the following:

  1. Open Bot A that has some LU data
  2. I have not provided my LUIS information yet, so when I start the bot I will be prompted to provide this.
  3. Open Bot B that has other LU data
  4. I have not provided my LUIS information yet, so when I start the bot I will be prompted to provide this.
  5. If I open Bot A again, the LUIS information for that bot is actually stored in local storage keyed off of the bot name. We should load this in, so when I click Start Bot I am not prompted again for provide the information.

@liweitian to your point about the Settings page - you're correct. When provided by a user, the LUIS publishing information should be written into the Settings data, and this would be the place to modify such information. We should still keep the pop-up experience, but write this data to the Settings page when users provide it.

cwhitten avatar Aug 16 '19 15:08 cwhitten

I like @cwhitten scenario outline.

I think that #5 is not a P0 for public preview. With that said, it will be nice behavior. When we introduce multi-users, we'll need to revisit this in any case, to enable setting per given user/ environment. With that in mind, the keys are not just per user, they also depend on environments (aka which bot i deploy to).

yochay avatar Aug 17 '19 20:08 yochay

@yochay we’re already writing this data to local storage. We only need to wire it in when a bot gets opened. This was the original behavior actually so this issue is partially a regression.

cwhitten avatar Aug 17 '19 22:08 cwhitten

@yochay we’re already writing this data to local storage. We only need to wire it in when a bot gets opened. This was the original behavior actually so this issue is partially a regression.

yes, that's the design, and i can't repro the issue yochary described, i suspect the problem is not a regression in code, it's more like a previous bot with same name have already take the key (botname), and not triggering a new popup.

the proper fix to me will be set a timeout for local storage to expire.

boydc2014 avatar Aug 19 '19 02:08 boydc2014