No safeguards from infinite recursion?

I have two update queries - one JS and one SQL, whose titles both start with the word "Update". (Let's call them "UpdateJS" and "UpdateSQL", respectively.)

I was intending to call UpdateSQL in my JS query, supposedly typing UpdateSQL.trigger() but didn't notice that autocomplete suggested UpdateJS. So instead of calling the SQL query, I accidentally called UpdateJS.trigger() inside UpdateJS, causing an infinite recursion and rendering the app unresponsive (couldn't even refresh the page).

It took several tests for me to realize that I had called the function on itself - just thinking that maybe there be some sort of validation for query triggers inside queries, ensuring that the query isn't invoking itself.

Hi @lazymaplekoi This is a good callout! Currently, what you experienced is the expected behavior

Just in case you're still not able to get into the app, you can use this approach to step back to before the JS query was accidentally called by itself. Since you just made the change you can probably open the app with the regular app url + the url param: ?_historyOffset=2. Once the app safely opens, you can make a small change (fix the query & save) to make this the current version.

1 Like

It looks like our logic team is exploring the best way to handle this, so I shared your particular example of two query names that start with the same word.

1 Like