-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Fix unresolvable promises #1270
Conversation
Good catch, thanks for your contribution! This also seems to be the behavior for when a synchronous entry point handler returns It would also be great if you could add a unit test that tests for this bug, so we won't have any regressions in the future. It should probably look similar to this test. Edit: I don't think the caveat you mentioned is real, pretty sure it is already not possible to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a test and documentation
@vasinkd is test and docs something you would like to do an attempt at? |
Totally forgot about this. @jsmnbom , thanks for a reminder! Ok, I'll add tests, no problemo. |
Thanks a lot :D
So a note in the ConversationHandler class docstring about this behaviour (both sync and async) sounds good yea :) |
Done. Sorry for the delay! |
Test for this instance passed. Can we merge for V12 @jsmnbom ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean. Yea let's merge it :)
CI is running, should be able to be merged in v12 |
Merged V12 after making small adjustment there regarding conversationhandler. If CI agrees we can merge. |
Also include #1270 even though not merged yet, but it should be very soon :)
Situation:
We use ConversationHandler with run_async decorator and an entry_point function returns
None
Result:
We stuck within conversation state
(None, Promise)
since Promise returnsNone
andNone
means we do not update conversation state.Solution:
If Promise returns
None
AND old state isNone
- exit Conversation Handler.Caveats:
May be not suitable if a programmer uses
None
as a valid state in Conversation states dict. But why would anyone do that?