Closed
Description
Version
v4.5
Describe the bug
When you send an invalid number to a NumberPrompt
, it sends out a retry prompt.
When attempting to send a 2nd response after being reprompted, you get a timeout error.
To Reproduce
- Create a
NumberPrompt
object - When it prompts you for a number, send in a non-numeric value (e.g.
"hello"
)- this will trigger a retry prompt (e.g.
"You must enter a number."
)
- this will trigger a retry prompt (e.g.
- Try sending in another value--no matter what type of value, you get a timeout error
Expected behavior
To be able to send in a 2nd value when reprompted
Additional context
async def test_number_prompt_retry(self):
async def exec_test(turn_context: TurnContext) -> None:
dialog_context: DialogContext = await dialogs.create_context(turn_context)
results: DialogTurnResult = await dialog_context.continue_dialog()
if results.status == DialogTurnStatus.Empty:
options = PromptOptions(
prompt=Activity(type=ActivityTypes.message, text="Enter a number."),
retry_prompt=Activity(
type=ActivityTypes.message, text="You must enter a number."
),
)
await dialog_context.prompt("NumberPrompt", options)
elif results.status == DialogTurnStatus.Complete:
number_result = results.result
await turn_context.send_activity(
MessageFactory.text(f"Bot received the number '{number_result}'.")
)
await convo_state.save_changes(turn_context)
adapter = TestAdapter(exec_test)
convo_state = ConversationState(MemoryStorage())
dialog_state = convo_state.create_property("dialogState")
dialogs = DialogSet(dialog_state)
number_prompt = NumberPrompt(
dialog_id="NumberPrompt", validator=None, default_locale=Culture.English
)
dialogs.add(number_prompt)
step1 = await adapter.send("hello")
step2 = await step1.assert_reply("Enter a number.")
# TODO: something is breaking in the validators or retry prompt
# where it does not accept the 2nd answer after reprompting the user
# for another value
step3 = await step2.send("hello")
step4 = await step3.assert_reply("You must enter a number.")
step5 = await step4.send("64")
await step5.assert_reply("Bot received the number '64'.")
[bug]