Show warning when trying to run app that is already running

What I want
When I have multiple IDEs open on the same app, the app running on one of the IDEs and I click on the green Run button on another IDE, I would like to have a 4 option question saying:

  • Another IDE is running the app, do you want to:
    • Stop the running instance and start a new one
    • Keep it running and start a new instance
    • Switch the focus to the running instance and to the running IDE
    • Cancel

Why I want it
I ended up, while having multiple IDEs open on the same app, unintentionally running the app from two different IDEs, having two separate tabs running the app, in slightly different versions, and having two consoles reporting seemingly inconsistent info.

I was testing the running app in one of the running app tabs and checking the console on the other IDE, and it was a mess.

Seemingly inconsistent until the moment you realize that you inadvertently ran the app twice.


In other words, you may want to run the app twice, but it’s very unlikely. It is more likely that you wanted to just restart the app after doing some editing, and lost track of which IDE was the one that started the app.

3 Likes

Definitely second this.

There are many database-based apps here, many with per-user data. In that case, having the same app-user logged in more than once, at the same time, from different instances, risks serious inconsistencies in that app-user’s data. Not because of anything Anvil does, but because it is a situation the App developer often doesn’t anticipate, and code for. So this “oops!” could actually muck up a serious amount of test data – or real data.

The app-user may be smart enough to always avoid simultaneous log-ins, but we developers goof up far more often than we’d like to admit. :wink:

1 Like