Repository: microsoft/botbuilder-python

Issue:
NumberPrompt doesn't accept retry value
## 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
1. Create a `NumberPrompt` object
2. 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."`)
3. Try sending in another value--no matter what type of value, you get a timeout error

![image](https://user-images.githubusercontent.com/35248895/62598200-7000fd00-b89d-11e9-9b02-cc04beb609d4.png)

![image](https://user-images.githubusercontent.com/35248895/62598223-8444fa00-b89d-11e9-918b-8578efd179ac.png)




## Expected behavior
To be able to send in a 2nd value when reprompted

## Additional context
```python
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]



Discussion:

Resolving patch:
diff --git a/libraries/botbuilder-dialogs/botbuilder/dialogs/prompts/number_prompt.py b/libraries/botbuilder-dialogs/botbuilder/dialogs/prompts/number_prompt.py
--- a/libraries/botbuilder-dialogs/botbuilder/dialogs/prompts/number_prompt.py
+++ b/libraries/botbuilder-dialogs/botbuilder/dialogs/prompts/number_prompt.py
@@ -40,7 +40,7 @@ async def on_prompt(
             raise TypeError("NumberPrompt.on_prompt(): options cannot be None.")
 
         if is_retry and options.retry_prompt is not None:
-            turn_context.send_activity(options.retry_prompt)
+            await turn_context.send_activity(options.retry_prompt)
         elif options.prompt is not None:
             await turn_context.send_activity(options.prompt)
 


Test patch:
diff --git a/libraries/botbuilder-dialogs/tests/test_number_prompt.py b/libraries/botbuilder-dialogs/tests/test_number_prompt.py
--- a/libraries/botbuilder-dialogs/tests/test_number_prompt.py
+++ b/libraries/botbuilder-dialogs/tests/test_number_prompt.py
@@ -125,9 +125,6 @@ async def exec_test(turn_context: TurnContext) -> None:
         test_flow4 = await test_flow3.send("Give me twenty meters of cable")
         await test_flow4.assert_reply("You asked me for '20' meters of cable.")
 
-    # TODO: retry_prompt in NumberPrompt appears to be broken
-    # It when NumberPrompt fails to receive a number, it retries, prompting
-    # with the prompt and not retry prompt in options
     async def test_number_prompt_retry(self):
         async def exec_test(turn_context: TurnContext) -> None:
             dialog_context: DialogContext = await dialogs.create_context(turn_context)
@@ -161,14 +158,11 @@ async def exec_test(turn_context: TurnContext) -> None:
         dialogs.add(number_prompt)
 
         step1 = await adapter.send("hello")
-        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'.")
+        step2 = await step1.assert_reply("Enter a number.")
+        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'.")
 
     async def test_number_uses_locale_specified_in_constructor(self):
         # Create new ConversationState with MemoryStorage and register the state as middleware.
@@ -272,13 +266,12 @@ async def validator(prompt_context: PromptValidatorContext):
 
         step1 = await adapter.send("hello")
         step2 = await step1.assert_reply("Enter a number.")
-        await step2.send("150")
-        # 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
-        # step4 = await step3.assert_reply("You must enter a positive number less than 100.")
-        # step5 = await step4.send("64")
-        # await step5.assert_reply("Bot received the number '64'.")
+        step3 = await step2.send("150")
+        step4 = await step3.assert_reply(
+            "You must enter a positive number less than 100."
+        )
+        step5 = await step4.send("64")
+        await step5.assert_reply("Bot received the number '64'.")
 
     async def test_float_number_prompt(self):
         async def exec_test(turn_context: TurnContext) -> None: