Question:
WiX Stores and CMS tables have extreme delays untill data is saved and readable…
Product:
Stores, CMS
What are you trying to achieve:
I work with Orders data from Store, after the purchase i read the order data and process it to potencially present additional fuctions. I also store this data to custom table in CMS and read them later for processing.
What have you already tried:
I have implemented multiple reads if the data is not present, i have indexes on the custom tables, i periodically clean the tables of older values.
Additional information:
I can see that the customer orders and pays for the order, gets to the Thank You page. From the load of this page it can be 13s before the order data is present to read from Stores/Orders table. At first it usually returns order number of 0 or the order is undefined ( $w(‘#thankYouPage1’).getOrder() );
After the delay the data is ok (i do multiple reads untill this is ready), some of this data I save to my custom table in CMS. There is again a delay between saving and being able to read this data, which can be up to 25s even with indexes beind present and table having as little as tens of rows…
This has been no issue lets say 3 years ago and is usual lately and the delays become longer and more unpredictable… This script is present on tens of stores and behaves differently within each store and time… 
Are you able to share the code being used/the use case for the code? There might be some devs who can share tips for optomising the code.
It’s hard to say wha the cause is, or if this is applicable to your case, but have you explored eventual consistency with Wix Data? - https://dev.wix.com/docs/velo/api-reference/wix-data/introduction#api-reference_wix-data_wix-data-and-eventual-consistency - the timings mentioned sound relatively long, so it may not be this, but might be worth checking all the same 
Thank you for response. 
Im using wixData.query() so I understand “{ consistentRead: true }” is not for my case…
Regarding the Order loading delay. On Thank You page i have this:
$w.onReady(function () {
retryOperation(() => $w('#thankYouPage1').getOrder(), 3, 1000)
.then((order) => {
if (order) {
if (typeof order.number === 'undefined' || order.number == 0) {
console.warn("order.number " + order.number + " incorrect = reloading Thank you page..");
wixLocation.to(wixLocation.url);
throw new Error('Reloading Thank you page, order not saved yet..');
}
....
And for my case this morning as an example, the page had to be reloaded from 08:19:16.645 until 08:19:29.421 (four times), when it finally got the correct order.number. It returned order number 0 until then…
The retryOperation() is a additional failsafe if it completly fails, which has also happened before, but in this case, the getOrder works, just returs 0 as a order number, which is not correct…
So this is the first issue happening regularly…
At this point I need to get order data on thank you page, I am then processing name of the shipping method. I save the data into CMS table and also if the name matches my criteria I also open lightbox with additional logic (delivery pick-up point map), or not…
In other systems I would implement this into the Checkout page, but unless something changed, I assume this is not possible.
The overall goal is to implement pick-up map for customer’s selection if they selected specific delivery service (based on the shipping method name).
Hi, I am experiencing the same bug. up until a few weeks there was no problem but suddenly I started getting very long delays when saving to the CMS and then reading from it again. It may take several minutes even after I save something until it can be read. The stranges part is that I can open the table on CMS, look at the record see that on the CMS it is already submitted but when I try reading the data via JS I still get the “old” info. I tried the same method @ostryweb used to retry reading the data. for a few weeks it was enogh and it took 3-10 sconds. but now it may take even more the a minute. This is extreamly fustrating. does enyone know what to do?
Hi,
I’ve been experiencing the same problem as tiktik17 for 2 weeks, and I don’t understand why nothing is being done on the WIX side…
It’s important to me because it creates problems with reservations in my gym…