Data hook not firing on Live site; works fine in Preview

I have a simple one page site with one button, and a dataset linked to a database; and a table linked to that dataset: peterjanderson6724.wixsite.com/website-1 . Try it.
The page code is:

import wixData from 'wix-data';
$w.onReady(function () {
    $w("#dataset1").onReady(() => {
        $w('#table1').refresh()
    });
});
export function writeTestData_click(event) {
    let dateNow = new Date()
    let toInsert = {
        "testField": 'AAAA',
        'comment': 'Test Insert',
        'testDateText': dateNow.toString()
    };
    wixData.insert("TestData", toInsert)
        .then((results2) => {
            $w('#dataset1').refresh()
            console.log('INSERT SUCCESS', results2);
        })
        .catch((err) => {
            let errorMsg = err;
            console.log('INSERT FAIL', errorMsg);
        })
}

and there is a hook on the database ‘TestData’ as follows:

export function TestData_beforeInsert(item, context) {
    item.testField = 'BBBB'
    console.log('Data hook fired', item)
return item;
}

So what I expect to happen is that the page code inserts an item into the database with testField set to ‘AAAA’, and the hook changes the value of testField to 'BBBB.
This works fine in Preview, where all items in the database are written with testField value ‘BBBB’.
But on the live site all items in the database have testField value ‘AAAA’.
Why is the hook not firing on the live site?
Where am I going wrong?

What are the permissions on the database?

Anyone can read, create, update, or delete.

For anyone else experiencing this please note that this is a known bug.

For reference see Tomer’s comment on the post: https://www.wix.com/code/home/forum/community-discussion/data-hook-not-working-on-live-site-but-working-ok-in-preview

Thank you for acknowledging there is a bug.
And the solution that works for me is that suggested by Steve Cropper

return Promise.resolve(item);

in every hook! Thank you Steve.

Thank you for acknowledging there is a bug.
And the solution that works for me is that suggested by Steve Cropper

return Promise.resolve(item);

in every hook! Thank you Steve.

Steve’s fix has stopped working What’s going on?

Hey Peter,

As Tomer mentioned that it is a bug and currently they are working towards a fix so I advise you to try it after a little while.

P.S. handling the promise with an async/await function still seems to be working for me https://dudelemonweb.wixsite.com/userid/peter