Search code examples
mesibo

How do I manually sync a Mesibo profile with latest changes from server if that user published its data with LAZY mode?


I made a page where users can update their names and status just like WhatsApp & Telegram.

These changes are published using LAZY mode since I don't want to update every user using the app right away. I just want to fetch it manually when necessary (for example when the user open the chat view with that user). (https://mesibo.com/documentation/api/real-time-api/profiles/#profile-publishing-mode)

The problem is: how can I fetch the updated profile of other users?

Whenever I get the profiles with Mesibo.getProfile("address") the data is still not updated.


Solution

  • since I don't want to update every user using the app right away.

    Even if you use real-time mode, updates don't go to every user but only those users who have subscribed to it.

    https://mesibo.com/documentation/api/real-time-api/profiles/#subscribing-to-a-profile

    In lazy mode, it may be updated along with other profiles or when the message is received from the users. Before that, getProfile may not return the latest profile.

    If you are starting with mesibo, recommend using real-time mode and optimizing later using the lazy mode