Metadata out of sync error after updating User through JavaScript

Hi,

I'm updating a user through JavaScript ilke this:

Fullscreen
1
2
3
const userBean = app.data.createBean('Users', {id: app.user.id});
userBean.set('has_read', true);
userBean.save();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The save operation works, but after the user has been updated I keep getting 'metadata out of sync error', till I refresh the browser.

Fullscreen
1
2
3
4
5
6
{
error: "metadata_out_of_date"
error_message: "Your metadata or user hash did not match the server. Please resync your metadata."
metadata_hash: "f86c8baca62aea11496e614fe9710954"
user_hash: "102b9d1cd65dbe95f50ddfd6b2a45bc5"
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

What am I missing?

I'm working on Sugar 11.x

Any help appreciated. Thank you.

Volkan

Parents
  • We implement a feature for a customier which updates data of the authenticated portal user id via server side and it works without a big deal. We never tried updating via client side. Perhaps it is a clue.

    André Lopes
    Lampada Global
    Skype: andre.lampada
Reply
  • We implement a feature for a customier which updates data of the authenticated portal user id via server side and it works without a big deal. We never tried updating via client side. Perhaps it is a clue.

    André Lopes
    Lampada Global
    Skype: andre.lampada
Children
No Data