GladysAssistant / Gladys

A privacy-first, open-source home assistant
https://gladysassistant.com
Apache License 2.0
2.69k stars 285 forks source link

Some validation is missing in the scene action "Continuer seulement si" #2106

Closed StephBob closed 1 month ago

StephBob commented 3 months ago

This bug is related to the following forum discussion : https://community.gladysassistant.com/t/gladys-devient-injoignable-apres-quelques-heures-de-fonctionnement/8981/25

Describe the bug Some validation is missing in the action "Continuer seulement si", as it's possible to enter a value such as ",15" in the field that should only accept a numeric value. Here is a screenshot :

6647b3f031ecd842eddc0de338bc2783fe960806

Then, when a scene with such value is executed by Glayds, the following error occured : <warn> scene.executeActions.js:37 (executeAction) SyntaxError: Value expected (char 1) at createSyntaxError (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1623:17) at parseEnd (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1590:13) at parseParentheses (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1577:12) at parseNumber (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1550:12) at parseObject (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1534:12) at parseMatrix (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1466:12) at parseSingleQuotesString (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1382:12) at parseDoubleQuotesString (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1338:12) at parseSymbol (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1237:12) at parseCustomNodes (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1210:12) at parseLeftHandOperators (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1134:12) at parsePow (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1116:12) at parseUnary (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1105:12) at parsePercentage (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1065:12) at parseRule2 (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:1016:16) at parseImplicitMultiplication (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:988:12) at parseMultiplyDivide (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:958:12) at parseAddSubtract (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:931:12) at parseRange (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:893:14) at parseConversion (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:858:12) at parseShift (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:835:12) at parseRelational (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:797:19) at parseBitwiseAnd (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:783:16) at parseBitwiseXor (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:768:16) at parseBitwiseOr (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:753:16) at parseLogicalAnd (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:738:16) at parseLogicalXor (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:723:16) at parseLogicalOr (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:708:16) at parseConditional (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:679:16) at parseAssignment (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:632:16) at parseBlock (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:580:14) at parseStart (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:551:16) at string (/src/server/node_modules/mathjs/lib/cjs/expression/parse.js:75:14) at parse (/src/server/node_modules/typed-function/lib/esm/typed-function.mjs:1790:20) at string (/src/server/node_modules/mathjs/lib/cjs/expression/function/evaluate.js:50:14) at evaluate (/src/server/node_modules/typed-function/lib/esm/typed-function.mjs:1790:20) at /src/server/lib/scene/scene.actions.js:264:17 at Array.forEach (<anonymous>) at Object.condition.only-continue-if (/src/server/lib/scene/scene.actions.js:261:23) at executeAction (/src/server/lib/scene/scene.executeActions.js:32:35) at /src/server/lib/scene/scene.executeActions.js:66:13 at tryCatcher (/src/server/node_modules/bluebird/js/release/util.js:16:23) at MappingPromiseArray._promiseFulfilled (/src/server/node_modules/bluebird/js/release/map.js:68:38) at MappingPromiseArray.PromiseArray._iterate (/src/server/node_modules/bluebird/js/release/promise_array.js:115:31) at MappingPromiseArray.init (/src/server/node_modules/bluebird/js/release/promise_array.js:79:10) at MappingPromiseArray._asyncInit (/src/server/node_modules/bluebird/js/release/map.js:37:10) at _drainQueueStep (/src/server/node_modules/bluebird/js/release/async.js:97:12) at _drainQueue (/src/server/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/src/server/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues (/src/server/node_modules/bluebird/js/release/async.js:15:14) at processImmediate (node:internal/timers:476:21) { char: 1 }

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

StephBob commented 1 month ago

Juste a 'void' comment, as an answer to the stale bot...