Expression or script hangs when checking variables
Posted: 02 Dec 2016 21:16
Hi,
I have a weird problem when using expressions or scripts to check variables (local or global). Sometimes it works, but more often it doesn't. It happens in different flows, complex or simple. Let me give an example:
I have a flow that triggers on user presence and it makes a http request. After that I have a condition that says: "status_code == 200". Without the quotes of course. Another example:
A flow that sets a global variable inside a script (I checked in the settings that this variable exists afterwards, and it does) and another flow where I check that global variable inside a condition.
Both examples work sometimes (mostly the first 2 times, but that is not consistent either) but mostly the condition stays red and the flow just hangs forever. When I try to stop it manually nothing happens. I have to stop the service and start it again to stop the flow. I tried using an exception in the flow but that was useless because it doesn't go past the condition. And there is no error notification whatsoever - with or without exception handling.
Then I made a test: Inside one flow I deleted the expression and used an if-clause inside an action to check for the variable...and then that action stayed red forever. Somehow Automagic doesn't like that I check for variables and it doesn't matter if it's a condition or an action. The debug log doesn't show anything I'm afraid, so no help there. It's really weird overall.
Apart from nodes checking for variables everything works great. I have a few quite complex flows including checks for cell towers and wifi. I created my own widgets that I fill with data from a http response via json. For example I put weather data in a global variable and send that via tasker plugin to a widget. That works. But checking the status_code in a condition in that same flow freezes everything. I removed the status_code==200 condition in the flow and it just works flawlessly.
I hope I'm just overlooking something simple and it's not a nasty bug.
btw: I have a Samsung Galaxy Note 4 with Cyanogenmod.
I have a weird problem when using expressions or scripts to check variables (local or global). Sometimes it works, but more often it doesn't. It happens in different flows, complex or simple. Let me give an example:
I have a flow that triggers on user presence and it makes a http request. After that I have a condition that says: "status_code == 200". Without the quotes of course. Another example:
A flow that sets a global variable inside a script (I checked in the settings that this variable exists afterwards, and it does) and another flow where I check that global variable inside a condition.
Both examples work sometimes (mostly the first 2 times, but that is not consistent either) but mostly the condition stays red and the flow just hangs forever. When I try to stop it manually nothing happens. I have to stop the service and start it again to stop the flow. I tried using an exception in the flow but that was useless because it doesn't go past the condition. And there is no error notification whatsoever - with or without exception handling.
Then I made a test: Inside one flow I deleted the expression and used an if-clause inside an action to check for the variable...and then that action stayed red forever. Somehow Automagic doesn't like that I check for variables and it doesn't matter if it's a condition or an action. The debug log doesn't show anything I'm afraid, so no help there. It's really weird overall.
Apart from nodes checking for variables everything works great. I have a few quite complex flows including checks for cell towers and wifi. I created my own widgets that I fill with data from a http response via json. For example I put weather data in a global variable and send that via tasker plugin to a widget. That works. But checking the status_code in a condition in that same flow freezes everything. I removed the status_code==200 condition in the flow and it just works flawlessly.
I hope I'm just overlooking something simple and it's not a nasty bug.
btw: I have a Samsung Galaxy Note 4 with Cyanogenmod.