Updating variable automatically runs multiple queries

Goal: I am trying to update a temp state variable and then do nothing else. The problem is that whenever this temp state variable is updated, every query that uses this variable runs. All of these queries in question are set to run manually. They are a mixture of API calls and DB updates. They should not run until they are manually fired, and yet they do whenever this variable changes.

Steps:

  • Create a variable
  • Create a resource (API or db) that uses this variable, set it to manual execution
  • Manually change the variable, see these resources run.

Expected:

  • Create a variable
  • Create a resource (API or db) that uses this variable, set it to manual execution
  • Manually change the variable (or programmatically set it)
  • No resources run

I cannot find documentation about this reactive behavior, if it exists please send to me! At this point I am simply confused. Do I need to rearchitect the app assuming this reactive yet undocumented behavior?

I see this 'Updates' section in the state tab, but I have no idea what it means. Does every single event here run if this state variable is updated?

Even if the Query depends on a variable and even when you see the "Updates" with the query name under the Variable state, This still should not trigger the query if it is set to run Manually.

I just tested this and I could not reproduce it.

Would you mind sharing the type of the query you're using, I will try to test it on my end, I've tested this with a RestAPI query type and it works as it should.

Hey @Infinitybht thanks for the response! I double checked and I need to clarify the repro:

  1. Create a test var TEST_VAR
  2. Create an API req that uses the var in the req, such as https://www.google.com/search?q={{ TEST_VAR.value }}
  3. Manually change the initial value of the TEST_VAR and you will see the API req run in the debugger.

Is this expected? Do you know if there's an docs that document this?

Turns out I just needed to overhaul the app entry requests, which cleaned everything up. Thanks again for the help!

1 Like