Bug? - Homey Script card keeps running

Hey all,

Question, am I running into a bug? I’m working on a simple flow and for that I use a little HS. In it I’ve got a while loop. While developing you have multiple iterations on your code, right? It looks like Homey keeps every version running in the background after running the test/run button.

I’ve noticed this yesterday. But even a day later the code is still logging to the console. (refreshed tab).

Now, I’ve noticed the script stops running after a reboot.

So, three thoughts:

  • Is this a bug?
  • Why is there no stop running button?
  • Why does Homey not kill the code testing process after leaving the page.

It would have been useful to show the actual code, but I assume you have something like this?

while (true) {
 await fetch(...);
  await wait(2000);
}

EDIT: yes, it keeps running. Have reported it on Slack.

2 Likes

@robertklep Yes, indeed. Maybe the code should be watched and only run when the development modal is open. And killed on closing modal. Plus a kill button would be nice. Since you don’t want to close and open the card/modal for each code change.