Bug or user error? Subquery runs before success when confirmation modal is used

Hi,

I have the following setup in my app:

table1 gets data via local_query1

delete from table1 triggers local_query2, which calls global_query1.

local_query2’s onSuccess is set to trigger local_query1 so that the data in table1 is refreshed:

(delete from table1→local_query2→global_query1)

What I expect to happen: When a user deletes an entry from table1 the table is refreshed.

This works as expected, unless global_query1 has the confirmation modal set:

image

When that modal is set local_query2 calls it’s onSuccess immediately, which means table1 gets refreshed before the row is deleted.

Am I wrong to assume that onSuccess shouldn’t be called until global_query1 has actually run?

I believe that you need to call global_query1 only after the delete was successful.

Something is a little confusing for me: table1 gets the data from local_query1

deleting something from table1 will triggers local_query2 and then global_query1
if successful, it also triggers local_query1

isin’t global_query also refreshing local_query1?

Hi @juliomds

Global queries don’t call “local” queries because I reuse global queries a lot and I don’t want each change to trigger all local queries.

I also believe they are unable to? The GUI only let’s me pick other global queries in a global querys event handler.