AC2 flow calling JS does not have most recent data store items

Wappler Version : 6.0.0 beta 11 beta channel
Operating System :
Server Model:
Database Type:
Hosting Type:

Expected behavior

The items of a data store should be available to a javascript function, immediately after being updated

Actual behavior

The previous data store items are returned

How to reproduce

Given the following page flow:
It repeats over ingredients which is a data store component and updates each ingredient with new values.
After the repeat, I call a javascript function.

Screenshot 2023-10-06 at 11.02.12 AM

Inside the JS function, I reference the ingredients and it shows the items at their original (non-updated) values:

dmx.app.data.content.ingredients.data

Here is what a console.log() of the ingredients is from inside the function:

Notice that the prep ahead and ingredient is 12 fl oz.

I then change the servings, which triggers my page flow and subsequent function.

Here you can see that while the ingredients updated properly, the prep ahead (which comes from the javascript function) did not.

The console log shows the qty is still 12 (it should be 15)

I then call dmx.app.data from the console after everything has completed, and the qty shows the proper value of 15.

If I place a 100ms wait before calling the javascript function, it works as expected. But an arbitrary wait is never a great thing and is just a workaround.

dmxDatastore.zip (4.3 KB)

I’ve removed the debounce code which caused the delay in the update, it was there for performance when doing many updates in a repeat that it didn’t sync the data each time within the repeat. Now it will be a bit slower when updating many records but the data will always be in sync and more reliable which is probably a better solution.

Ya, I think knowing the data store is updated immediately upon exiting the repeat would be important.

Confirmed fixed.