# Updating user DisplayName not working

**URL:** https://forum.social.plus/t/updating-user-displayname-not-working/1185
**Category:** TS SDK
**Created:** [March 8, 2024, 6:02am UTC](https://forum.social.plus/t/updating-user-displayname-not-working/1185 "2024-03-08T06:02:51Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![geeky\_mohit](https://avatars.discourse-cdn.com/v4/letter/g/b38774/32.png) [@geeky\_mohit](https://forum.social.plus/u/geeky_mohit)
#### Post date: [March 8, 2024, 6:02am UTC](https://forum.social.plus/t/updating-user-displayname-not-working/1185/1 "2024-03-08T06:02:51Z")

</div>

Hi Team,

I’m using TS sdk , 6.19.0  
but while updating user displayName and avatar, I’m facing issue in updating displayName, avatar update is working fine

i checked network  
this api is getting called  
[https://api.eu.amity.co/api/v3/users/](https://api.eu.amity.co/api/v3/users/)  
method put  
this payload is being sent  
{userId: “0x19a4c6525fe784027f5caa72748893a091077c92”, displayName: “mohit test”}

and im getting 200 response

and in user data in response, is showing changed displayName although

but when i again login to chat or refresh chat  
I’m getting same old displayName  
but avatar image got changed fine

---

<div class="post-metadata">

### Author: ![geeky\_mohit](https://avatars.discourse-cdn.com/v4/letter/g/b38774/32.png) [@geeky\_mohit](https://forum.social.plus/u/geeky_mohit)
#### Post date: [March 8, 2024, 9:37am UTC](https://forum.social.plus/t/updating-user-displayname-not-working/1185/2 "2024-03-08T09:37:16Z")

</div>

@SocialPlus_Support are you checking this?

---

<div class="post-metadata">

### Author: ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)
#### Post date: [March 8, 2024, 10:22am UTC](https://forum.social.plus/t/updating-user-displayname-not-working/1185/3 "2024-03-08T10:22:43Z")

</div>

Hello, could you please confirm if you are using our UI kit? If so, what is your UI kit version?

---

<div class="post-metadata">

### Author: ![geeky\_mohit](https://avatars.discourse-cdn.com/v4/letter/g/b38774/32.png) [@geeky\_mohit](https://forum.social.plus/u/geeky_mohit)
#### Post date: [March 8, 2024, 10:26am UTC](https://forum.social.plus/t/updating-user-displayname-not-working/1185/4 "2024-03-08T10:26:52Z")

</div>

I’m using TS sdk , 6.19.0

---

<div class="post-metadata">

### Author: ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)
#### Post date: [March 8, 2024, 10:34am UTC](https://forum.social.plus/t/updating-user-displayname-not-working/1185/5 "2024-03-08T10:34:20Z")

</div>

So you’re developing your own UI and solely utilizing our TS SDK, is that correct? If so, please help share the relevant code. Thank you.

---

<div class="post-metadata">

### Author: ![geeky\_mohit](https://avatars.discourse-cdn.com/v4/letter/g/b38774/32.png) [@geeky\_mohit](https://forum.social.plus/u/geeky_mohit)
#### Post date: [March 8, 2024, 10:46am UTC](https://forum.social.plus/t/updating-user-displayname-not-working/1185/6 "2024-03-08T10:46:04Z")

</div>

I already shared you api , that being called  
can’t you guys check that api?

---

<div class="post-metadata">

### Author: ![geeky\_mohit](https://avatars.discourse-cdn.com/v4/letter/g/b38774/32.png) [@geeky\_mohit](https://forum.social.plus/u/geeky_mohit)
#### Post date: [March 8, 2024, 10:50am UTC](https://forum.social.plus/t/updating-user-displayname-not-working/1185/7 "2024-03-08T10:50:17Z")

</div>

![Screenshot 2024-03-08 at 4.17.48 PM](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/43417c130e5059387f84450c2941ba8c648beff8.png)

these 2 methods im using  
after updating user (which always get success)

when i try to get user detail again, i still old displayName data, but new image always coming

---

<div class="post-metadata">

### Author: ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)
#### Post date: [March 8, 2024, 1:09pm UTC](https://forum.social.plus/t/updating-user-displayname-not-working/1185/8 "2024-03-08T13:09:18Z")

</div>

Hello, yes, we have already tested our API, and it works as expected, aligning with what you mentioned:

> this payload is being sent  
> {userId: “0x19a4c6525fe784027f5caa72748893a091077c92”, displayName: “mohit test”}
> 
> and im getting 200 response
> 
> and in user data in response, is showing changed displayName although

Thank you for providing the code. We will forward it to the team for review, will keep you posted on any updates.

---

<div class="post-metadata">

### Author: ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)
#### Post date: [March 11, 2024, 11:49am UTC](https://forum.social.plus/t/updating-user-displayname-not-working/1185/9 "2024-03-11T11:49:53Z")

</div>

Hello @geeky_mohit , After you update the display name profile, please make sure that when you call Client.login. You pass the new display name to the function as well otherwise the display name will be replaced with the old one

```auto
  const response = await Client.login(
      {
        userId: userId,
        displayName: 'updated display name' // always pass the latest display name
      },
      sessionHandler,
    );

```

---

<div class="post-metadata">

### Author: ![geeky\_mohit](https://avatars.discourse-cdn.com/v4/letter/g/b38774/32.png) [@geeky\_mohit](https://forum.social.plus/u/geeky_mohit)
#### Post date: [March 11, 2024, 12:46pm UTC](https://forum.social.plus/t/updating-user-displayname-not-working/1185/10 "2024-03-11T12:46:03Z")

</div>

so i need to pass this everytime i login?

but then how i will get correct user details if some other user is trying to get user details by userId?

---

<div class="post-metadata">

### Author: ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)
#### Post date: [March 12, 2024, 6:39am UTC](https://forum.social.plus/t/updating-user-displayname-not-working/1185/11 "2024-03-12T06:39:36Z")

</div>

@geeky_mohit Other users will always get the correct user detail because the user data is already updated successfully, but the reason that the display name is changed is because it get replaced when you call that login function with old display name.
