Unread message count reappears after re-login or login from another device?

  1. The unread message count is stored in localStorage. It’s specific to the current client, and the server doesn’t store it.

  2. Clearing the local cache will cause the SDK to fetch offline/compensation messages again, and the unread count will be recalculated.

  3. Avoid directly clearing the browser cache or localStorage. If your code must delete localStorage data, only clear the data you’ve set, not everything.

  4. Use multi-device unread count synchronization to solve this issue.

Note: Switch the document version based on the SDK you’re using.