-
Notifications
You must be signed in to change notification settings - Fork 1
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 evaluation of Block exits when inbound message is a boolean-ish or numeric-ish string value #180
base: develop
Are you sure you want to change the base?
Fix evaluation of Block exits when inbound message is a boolean-ish or numeric-ish string value #180
Conversation
This pull request has been linked to Shortcut Story #30271: Reach (aka Praekelt.org): True/False Button options not working as expected within a Journey. |
…an-integer-button-labels-not-working
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'm happy with this change but we'll want to revisit this when we upgrade the Expression lib (which is where this problem originates).
@santiagocardo could you weigh in as well as you've dealt with this stuff before as well.
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.
LGTM!
Perhaps we can add something like score == 0
as another option in the then()
routhing test cases. To make sure we are also covering plain integers in these expression evaluations.
Right now the FlowRunner fails to match the correct Block exit when the inbound message is a string that contains a value resembling a boolean (e.g.
"True"
) or a number (e.g."123"
).This is because the
expression
package parses those strings values to proper booleans and numbers, which is not what we want when evaluating Blocks outgoing links.turnhub/expression#189 introduced a flag that we can use to disable the automatic parsing of booleans/integers and this PR introduces the usage of that flag in the FlowRunner to fix the evaluation of outgoing links in
SelectOneResponse
andCase
Blocks.