Access to the DB

Why are there days, like today, that accessing the DB from javascript doesn’t work on my site? I have several functions that access the Collections, take data to put on the button labels on the page. This operation doesn’t work today, why? I have not made any changes to the site.

Thanks
Claudio

I had something similar 2 days ago. Turned out the a query (which has been working fine for months) suddenly no longer returned a result. Have a look at the return value from the (empty) query. The parameters are repeated at the end. Have a close look to see if that’s your problem.

Thanks, yes, the effect is this, the queries don’t return anything (empty). but why does it happen? Today, for example, it’s ok.

@claudio-d-ambrosio Without any code I could not possibly tell. Maybe Wix even did another commit on wix-data, to fix some bug, I really do not know. So I would keep checking it for the next couple of days and if it returns, show code here, maybe we see something.

And important… If you encounter issues like this or other anomalies, keep in mind this forum is not a support site, and is not monitored for bugs or system issues . Please report bugs to Wix Customer Care to ensure timely handling of your problem. They track and monitor all incoming issues and will escalate bugs to product teams.

Lads did you find a reason to that behaviour or a solution? Looks like I have similar problem.

ok thanks

@giri-zano

Of these functions (access to the db, small calculation, and writing on the label button) I have many because I have many buttons placed on the page.
Could that be the problem?

Here is the example code I use
Thanks

    // query 1
    let queryGSC = wixData.query('CLASSEVEN_OK').eq('squadra', $w(hFuori1).label);
    queryGSC.find().then((resultsGSC) => 
    {
        let gginC = resultsGSC.items[0]['ggout'];
        let seC    = resultsGSC.items[0]['segnaf'];

        // query 2
        let queryGSCF = wixData.query('CLASSEVEN_OK').eq('squadra', $w(hCasa1).label);
        queryGSCF.find().then((resultsGSF) => 
        {
            let ggoutF = resultsGSF.items[0]['ggin'];
            let suF    = resultsGSF.items[0]['subitic'];

            // small calculation
            let percSegnaC = Math.round((Math.round((seC/gginC)*100) + Math.round((suF/ggoutF)*100))/2);
            
            // write on label button that displays nothing (sometimes).
            $w(gsFuori).label = String(percSegnaC);  
            
            if (parseInt($w(gsFuori).label, 10) >= 75)
            {
                $w(gsFuori).disable();
            }                        
        })
    })

@claudio-d-ambrosio Don’t see anything wrong with the code, except that you assume too much. E.g. if a query, for whatever reason, returns nothing, you still continue to work with the first (not available entry), which will not work.
So first, after each query, test like so:

if(resultsGSC.items.length >0){
	//rest of existing code here
}
else {
	console.log ("No rows found");
}

Then look at your logs when it doesn’t do what you expected.

I tried to contact Customer care but I can’t find the right topic in the list.
Today, for example, the refresh() function of the tables don’t work and I wanted to report it but I don’t know how to do it.

Hi, the problem is still there, I have contacted support @yisrael-wix but they have not solved the problem.
If I select a row on my table, and then call a refresh() function, the row stays selected. Why ??