Backendless User Property refresh

Hello,
If my BackendlessUser has a property type of data object relationship called UserStats how or when does that object get loaded / refreshed.

if user A can edit users B UserStats when would user B see the changes?

Previously I’ve been keeping them separate and then looking up UserStat via the objectID. I’m just trying to simplify and cut down on API calls.

Thanks
Robert

Hi @robert-j

A user object is just a Data object and when someone/somehow modifies it you need to notify each client using Messaging Service to get up-to-date data or you can use our RealTime feature:

  • on the client add listeners
  • when the data is changed on the server it sends an event to each client and it runs listeners

here is a doc for JS Overview - Backendless SDK for JavaScript API Documentation

Regards,
Vlad

Does getCurrentUser() pull locally or will that query the database for a updated user?

The getCurrentUser() method has an optional boolean argument. When set to true, it will force a refresh of the current user object from the server. Otherwise, it will return the object already available on the client side.

Regards,
Mark

Perfect, thanks!

The Docs don’t have this in it as far as i can tell.

Thanks

You’re correct. we will update the documentation to reflect this.

Regards,
Mark