Programmatically stop all running queries

I'm building a Retool app which builds a queue of objects gathered from paginated queries. As those objects are returned, more queries are triggered to fetch related objects. This means that in order to build the queue, multiple queries may be running at any given time.

When the user switches queue types, I clear out the current queue and I would like a way to essentially stop all the already running queries before triggering the new query to start populating the new queue type.

As it stands, it's possible for the new queue to start filling up with results from the old queue's queries that hadn't yet completed at the time of the queue switch.

I realize I could work around this by having separate queue temporary state variables for each type of queue, but it would be handier if there were simply something like runningQueries.stopAll().

9 Likes

:+1: I really want this feature,

Sometimes this approach of state per query doesn't work if you have sub-promise in query chain

Thank you for your +1 here, @renatovico! This request has been filed and linked to the thread, so I'll keep y'all posted with any updates :slightly_smiling_face:

Any update on this please? @victoria

Hey @krynv :slightly_smiling_face: This is currently on hold to prioritize other work, but will add your bump internally now!

2 Likes

Hello Victoria, bumping this thread up. Has this been prioritized already? :blush:

Hey Kelvin! Not prioritized yet, but will bump internally again. Thank you for the bump here, it truly does help us know what to work on!

Hello @victoria . Anything on this? This feature would really cut down my apps' loading times!

@joudi thanks for asking -- Appreciate you sharing the app loading performance reason for your interest in this feature. Makes sense!

I've surfaced your interest in this internally to our Eng team! It sounds like there are other priorities on the docket for that team to work on ahead of this one in the near-term. So no new update yet. The internal ticket with our engineers is linked for us internally, so we'll update this topic if there's new news :slight_smile:

I reiterate my +1 this thread it's really needed.

Hi @kbn please I'm looking for this feature too, so add mine +1

Logged those +1s. Thank you!

I would love something like this!

I'm also going to put one of my wishlist items here, since it is sort of relevant?

I would love if you could build in some sort of loop detection, that would be amazing.

I have gotten myself in the situation before where 2 queries are calling each other indirectly and I would love some way to prevent that loop, kill all running queries, or alert me that I have the set myself up for a loop.

2 Likes

I've actually ran into this too! I agree it would be great to build in some sort of alert system.

1 Like