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

[PORT] Hardened prompts #2271

Closed
tomlm opened this issue May 21, 2020 · 1 comment · Fixed by #2246
Closed

[PORT] Hardened prompts #2271

tomlm opened this issue May 21, 2020 · 1 comment · Fixed by #2246
Assignees
Labels
Area: Engineering Internal issues that are related to improving code quality, refactorings, code cleanup, etc.

Comments

@tomlm
Copy link
Contributor

tomlm commented May 21, 2020

Port this change from botbuilder-dotnet/master branch:
microsoft/botbuilder-dotnet#3949

See parent PR: #2246

Description

Some of the prompts break if user uploads an attachment instead of responding with text because of some of the string methods that get called on activity.text (which doesn't exist if an attachment is sent).

Specific Changes

Add some variation of

if (string.isNullOrEmpty(turnContext.Activity.Text)) {
  return Task.FromResult(result);
}

to:

  1. ChoicePrompt
  2. DatetimePrompt
  3. NumberPrompt
  4. ConfirmPrompt

I also renamed message to utterance to be more in line with other prompts.

The original issue was only for DatetimePrompt, but I added the other two. Other prompts didn't seem relevant for this.

Changed projects

  • Microsoft.Bot.Builder.Dialogs
@mdrichardson mdrichardson self-assigned this May 26, 2020
@tracyboehrer tracyboehrer added the Area: Engineering Internal issues that are related to improving code quality, refactorings, code cleanup, etc. label Jun 12, 2020
@mdrichardson
Copy link
Contributor

Already covered in original PR: #2246

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Engineering Internal issues that are related to improving code quality, refactorings, code cleanup, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants