Skip to content
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

sanitize command output message #108

Open
fblackburn1 opened this issue Apr 19, 2021 · 0 comments
Open

sanitize command output message #108

fblackburn1 opened this issue Apr 19, 2021 · 0 comments

Comments

@fblackburn1
Copy link
Owner

fblackburn1 commented Apr 19, 2021

I opened this issue to write thoughts about pros/cons of the solution. Don't hesitate to add your propositions

Issue

Given I have many command nodes in my flow
Given the message pass through a command node with msg.command=setLevel and msg.arguments=10
When the message pass through a second command node and with only set msg.command=on
Then a error is triggered because command node try to send on with argument 10
Result: no command is sent
Expected: command is sent and executed correctly

Workaround: remove msg.arguments property before sending on message

Propositions

1. Do nothing

Leave up to the user to sanitize it's message before sending to the command node

2. sanitize command node output

It will remove msg.deviceId, msg.command, msg.arguments` attributes
Note: due to the first disadvantage, I can only consider this proposition with the checkbox option in the node

pros:

  • Userfriendly when using command node on generic flow (dynamic deviceId/command/arguments)

cons:

  • Simple flow chaining command node will not more anymore !!
    • can be mitigate with a check box option in the command node
  • can be harder to debug and know what was given in the node input
  • http request node doesn't sanitize output, so it will leave a different behavior from builtin node

consideration:

  • should be done for device and maybe other nodes too
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant