-
-
Notifications
You must be signed in to change notification settings - Fork 782
Fix a bug in invalid action alias array parameter casting #5141
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
Conversation
Code would incorrectly try to cast a value to a list even if it's already a list which means it would break in scenarios when value is already a list (e.g. when parameter contains a default value or when immutable_parameters are used with an action alias).
|
Added tests. It was quite painful. My old development environment was not working and getting a new one up also took much longer then it should (couldn't find any good up to date docs so I created one myself from scratch). |
|
On a related note - I assume the whole str to list casting code was added as a quick hack / workaround at some point in the past to make it easier to specify lists in a chat. It's not ideal or complete since it doesn't handle more complex scenarios (e.g. lists of objects with |
arm4b
left a comment
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.
👍
This pull request fixes a bug in action alias array parameter value casting when executing an alias.
The code would incorrectly assume value is always a string and try to cast it to an array (the value may very well be a string when executing command from chat, but even then is not always true).
This would not work if value is already a list (e.g. if parameter contains a default value or a default value is specified using
immutable_parametersin action alias definition).Background, Context
I encountered this bug when trying to define a default value for a parameter in action alias which is a list.
Here is action alias definition in question:
TODO