Enum Value Triggered Collapse Motion Not Running in Stage

Hi,

We’re experiencing some weird behavior in the Stage environment. In our app, we’ve set a custom list using an iterate container that iterates over a database-connected data source. Each container has an On Click Event Handler that updates a Runtime Variable set with an Enum Data Type. The Enum has two values; ‘Fold’ and ‘Unfold’. The iterate container also contains another container that will display some additional information. This second container is set with a Collapse Motion where the Motion In is controlled by the object in context’s Enum value like this → Motion In: Object’s Enum value EQUAL ‘Fold’.

Screenshot 2024-04-09 at 08.23.26

When the first container is clicked, an action is called. The action itself runs two ifs in parallel. The first if checks if the object in context’s Enum value != ‘Fold’, and update the property to be ‘Fold’ before ending the execution. The second if checks if the Enum value == 'Fold, and updates the property to be ‘Unfold’ before ending the execution.

This logic works fine in Dev and Test but when validating in Stage, the second container isn’t “Unfolded” (the collapse motion doesn’t run possibly due to the Enum value not updating). We’ve experienced this before and have a workaround that updates a boolean rather than the Enum, and use a function to control the Enum’s value.

Any idea why this is happening or what this bug is?

After some more debugging and testing, it appears that it’s the parallel run of the if-statements that is causing this issue in Stage. Both ‘Parallel’ and ‘First-to-finish’ “fail” in Stage, while ‘Sequential’ works as expected. Hope this helps in fixing this bug :slight_smile:

I’m unable to deploy to Prod at the moment, so I’m not sure if the issue exists in that environment as well.

Hi!

To me this sounds like a case where parallell execution is unsuitable. Those IFs must be independent of each other in order to parallell execution to work. It sounds as if the content inside the first IF might affect evaluation of the other IF.

So I believe you are experiencing minor timing differences in Test vs Stage - causing different behaviour/result.

Correct me if I’m misunderstanding this use case.

1 Like

Appreciate your input, @kristian

You’re right, now that you point it out, parallel execution doesn’t make much sense to use here. It’s the Test vs. Stage differences that had me scratching my head - I mean, we have the same logic using bool types on data source or enum types on app variables, and both these setups works just fine across all environments. I guess it has to do with the enum type as runtime property on a data source being more sensitive to the timing differences in Test vs. Stage?

Nevertheless, appreciate your insight on this :smiley:

1 Like

Nice.

I’m guessing the performance in Stage vs Test is the main difference. “Too fast” in stage causing opposite evaluation in this case.