Local Storage user object not updated when logging in with same user

Hi,

we store information regarding muted/archived groups in the metadata of a user object.

  1. When I log in with a user, I can see the user object in the local storage.

  1. I change some info in the metadata (in production, for example, this could happen when a user adds a chat to mute/archive list). I simply change the name of the user in the Metadata tag.

  1. I log in again with the same user. The old (not updated) version of the user object is in Local Storage.

When I log in with a totally different user, THEN log in again with the original user, then the updated Local Storage user object/key is in place.

Hello @Dr_Kurt ,

When you update the metadata via the Dashboard the SDK does not know that there was an update in the User Object and hence the older version of the user object is present in the local storage. Can you please let me know the version of the CometChat JS SDK & also can you please let me know how you are updating the metadata of a user in your live app?

Warm Regards,

CometChat
Mayur Bhandari

@mayur.bhandari : Will the metadata be updated when I change it using the SDK or Angular UI Kit if possible?

We use the 2.0.6 SDK / Angular UI Kit 3.0.6-1.

What would be the right way to add metadata tags and put them in immediate effect?

Hello @Dr_Kurt,

I think you mean the SDK version 3.0.6 & not 2.0.6. Please confirm.

Yes, you can use the updateCurrentUserDetails() method of the SDK. You can read more about this method here.

Hope this helps.

Warm Regards,

CometChat
Mayur Bhandari

Sorry, of course it’s the 3.0.6 SDK. We’ll try using the updateCurrentUserDetails()-method.

Hi @Dr_Kurt,

Just checking in to see if the issue has been resolved from your end. Please get back to us if you have any questions. We will be happy to help you!

Regards,
Rahul