简体   繁体   中英

Why does the retry prompt only show once?

I've been working with the bot framework for some time now and it always bothered me that the RetryPrompt only shows once.

I've looked through the github source of bot builder and it appears to be that the message actually gets send, but does not get displayed in the Bot Framework Emulator.

Snippet from the MultiTurnPromptBot sample:

var promptOptions = new PromptOptions
                {
                    Prompt = MessageFactory.Text("Please enter your age."),
                    RetryPrompt = MessageFactory.Text("The value entered must be greater than 0 and less than 150."),
                };

                return await stepContext.PromptAsync(nameof(NumberPrompt<int>), promptOptions, cancellationToken);

I would expect to get the RetryPrompt everytime my message fails the validation. As you can see here the message "The value entered must be greater than 0 and less than 150" gets displayed only once. But in the log it actually shows both messages.

My guess is that the emulator get confused because both messages actually have the same id (as you can see here and here ).

Does anyone know if this is happens in other channels too and/or if this is a bug/feature?

This seems to be a bug with the Emulator. If you look at the log panel in your screenshots, the Activity holding the invalid value message is getting sent in to the Emulator, and you can inspect it normally but it isn't showing up the message in the chat control. Tested it on the latest and previous versions of the Emulator(works fine for the lower version, the bug seems to be in the latest version).

Attached is the link to the bug filed on the BotFramework-Emulator repo.

Hope this helps!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM