Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some changes are needed to 21.corebot-app-insights #2203

Closed
WashingtonKayaker opened this issue Feb 24, 2020 · 0 comments · Fixed by #2219
Closed

Some changes are needed to 21.corebot-app-insights #2203

WashingtonKayaker opened this issue Feb 24, 2020 · 0 comments · Fixed by #2219
Assignees

Comments

@WashingtonKayaker
Copy link
Contributor

WashingtonKayaker commented Feb 24, 2020

In reviewing the javascript_nodejs version of sample 21.corebot-app-insights, I've noticed a few issues that I think need to be addressed:

  • Need to incorporate the changes made in PR1964 Override ActivityHandler.run() instead of using ActivityHandler.onDialog() to save state changes. This impacts dialogBot.js.

    This is the current code:

     this.onDialog(async (context, next) => {
     	// Save any state changes. The load happened during the execution of the Dialog.
     	await this.conversationState.saveChanges(context, false);
     	await this.userState.saveChanges(context, false);
    
     	// By calling next() you ensure that the next BotHandler is run.
     	await next();
     });

    This is how it should be coded:

     async run(context) {
     	await super.run(context);
    
     	// Save any state changes. The load happened during the execution of the Dialog.
     	await this.conversationState.saveChanges(context, false);
     	await this.userState.saveChanges(context, false);
     }
  • Need to incorporate the changes made in PR1868: add send trace calls and fix multiling.

    The following code needs to be added to index.js probably starting on line 48…

     // Send a trace activity, which will be displayed in Bot Framework Emulator
     await context.sendTraceActivity(
     	'OnTurnError Trace',
     	`${ error }`,
     	'https://www.botframework.com/schemas/error',
     	'TurnError'
     );
  • A console.log line is missing, see line 88 in index.js

     console.log('\nTo talk to your bot, open the emulator select "Open Bot"');
  • Missing braces in mainDialog.js. These were added to CoreBot the end of October. See line 82, 98, 100, 105, 107, 111

  • CancelAndHelpDialog.js: Same thing – missing braces in switch statement. See line 26 etc. Compare with CoreBot line 26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants