Interval not firing when action called as "execute action" step

I have an action (let’s call it ActionA for clarity’s sake) that uses the interval step. When executing ActionA directly when building an app, or when linking the action directly as an event (i.e. a button onClick event), it works as expected, firing on the interval until the cancel condition is met.

I had this action being called from an “Execute Action” step of another action (we will call this one ActionB), and it was working as expected, until yesterday. now, when ActionB is triggered, it still triggers ActionA, but ActionA only executes once, and does not execute on the defined interval.

Again, ActionA’s behavior is different when executed as the action linked to an event vs when it is called from an Execute Action step.

The action log tab does not show any errors or warning when either action is triggered.

Hi!

Could you shed some light on actions’ settings?
I built an example app according to your description and it works like a charm :thinking:

Here is the action that uses the “Execute Action” step:


Here is the action that uses the interval:

The first action saves a value in a state variable (verified).

The action with the interval is meant to execute every 30 seconds and clear that state variable if the experation value has been exceeded.

Hello @Joe_Alcorn,

I tested this with a similar setup as you showed in the images and like @spherebread says, it worked like a charm. (UI Bakery v3.97.0 and v3.103.0)

Based on your images I assume that the action in the first image sets the state variable to either true or false based on some condition, so the only thing I can think of is that when the action with the interval is being executed, state.verified.status is already set to false and the interval only runs once.

1 Like

Thanks for the sanity check. I did go back and double check the logic.

When I manually execute the action, it behaves as expected, but when the action is executed via the button onClick event, it exhibits the behavior I described in the original post. The only difference that I can see is how the action is executed.

That lead me to look deeper at everything in the logic chain. I found the root cause:

If you have an action that starts an interval executed by a button in a modal dialog, if the action closes the modal dialog, it looks like it kills the execution context or something, causing the interval to no longer work. As soon as I disabled the step that closed the modal dialog, the interval started working.

After that, closing the modal dialog manually immediately stops the execution of the interval, regardless if the stop condition is met or not.

2 Likes

I was able to fix it by changing the logic to use the onClose event for the modal dialog passing in the values from the UI and executing the interval in that event.

2 Likes

Glad that you were able to find out what’s going on! Not knowing about the modal I, pressumably also @spherebread, tested this with just a normal button. (looking closer now I spot the closeModal step :sweat_smile:)

@spherebread This might be something to check if this behaviour was intended and if so, maybe mentioning this in the docs :+1:t3:

1 Like

I should have mentioned the modal, TBH, so not surprised it wasn’t on anyone’s radar =)