Difference between Live and Sandbox DatasetSaving

The behavior of my live and sandbox site is different and it was working on live for 6 months at least.
I noticed recently there are a TON of invalid IDE errors which work fine on sandbox. Things like number type inputs saying they only accept strings but if you pass them a number it actually works while if you pass them a string it doesn’t.

But besides that I have a fairly simple form but some of the values can change via code so when I submit I save values directly

export async function saveData_click ( event ) {
$w ( “#dataset1” ). setFieldValue ( “protein” , parseInt ( $w ( ‘#proteinAmt’ ). value , 10 ))
$w ( “#dataset1” ). setFieldValue ( “carb” , parseInt ( $w ( ‘#carbAmt’ ). value , 10 ))
$w ( “#dataset1” ). setFieldValue ( “fat” , parseInt ( $w ( ‘#fatAmt’ ). value , 10 ))
$w ( “#dataset1” ). setFieldValue ( “macroSplit” , $w ( ‘#radioMacro’ ). value )
$w ( “#dataset1” ). setFieldValue ( “calorieTarget” , parseInt ( $w ( ‘#totalCalories’ ). value ))
console . log ( “using” , parseInt ( $w ( ‘#totalCalories’ ). value ), “for calories” , typeof ( parseInt ( $w ( ‘#totalCalories’ ). value )))
$w ( “#dataset1” ). setFieldValue ( “deficit” , $w ( ‘#deficit’ ). value )
}

However it doesn’t actually save these fields anymore (it did for a long time as this has been live about a year) other values that are directly input by the user save just fine. In addition the .new() method on datasets seems to not work well anymore.

export async function dataset1_ready () {
if ( $w ( ‘#dataset1’ ). getTotalCount () === 0 ){
console . log ( “creating a new entry” )

await $w ( ‘#dataset1’ ). new ()
console . log ( “total rows is now” , await $w ( ‘#dataset1’ ). getTotalCount ())
$w ( ‘#dataset1’ ). save ()
}

I never used to have to do .save(), now I have to or it doesn’t actually create an entry. And also the input fields are not editable until the user refreshes the page which was never the case before. I had this page turned off for awhile while we were doing other things. About 7000 people had used it successfully over the course of about a year. When I turned it back on it isn’t working for anyone anymore.

Even if you have existing data, nothing saves. It just reverts back to what was previously in the dataset after you click the submit button. Is there something that has changed in code to update these values and create new entries?

Oh and 1 edit. This works fine on sandbox when previewing the site. The writing works just fine. It doesn’t on live though.