简体   繁体   English

为什么重试提示只显示一次?

[英]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.我已经使用 bot 框架有一段时间了,RetryPrompt 只显示一次总是让我感到困扰。

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.我查看了 bot builder 的 github 源,似乎消息实际上已发送,但未显示在 Bot Framework Emulator 中。

Snippet from the MultiTurnPromptBot sample: MultiTurnPromptBot 示例的片段:

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.每次我的消息验证失败时,我都希望得到 RetryPrompt。 As you can see here the message "The value entered must be greater than 0 and less than 150" gets displayed only once.正如您在此处看到的,消息“输入的值必须大于 0 且小于 150”仅显示一次。 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 ).我的猜测是模拟器会感到困惑,因为这两条消息实际上具有相同的 id(如您在此处此处看到的)。

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.如果您查看屏幕截图中的日志面板,则包含无效值消息的 Activity 正在发送到模拟器,您可以正常检查它,但它没有在聊天控件中显示消息。 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.附件是 BotFramework-Emulator 存储库中提交的错误的链接。

Hope this helps!!希望这可以帮助!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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