Skip to content

[Prod] Can't update Profile Information on newly created users #5638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nursoltan-s opened this issue Jul 9, 2021 · 9 comments
Closed

[Prod] Can't update Profile Information on newly created users #5638

nursoltan-s opened this issue Jul 9, 2021 · 9 comments

Comments

@nursoltan-s
Copy link
Collaborator

Describe the bug
Cannot update user traits (v3) on Profile page on production environment. Error only occurs "newly" created users. (works fine on old users)

To Reproduce
Steps to reproduce the behavior:

  1. Login with "CustomerUser" account.
  2. Go to 'https://www.topcoder.com/settings/profile'
  3. Click on 'Basic Info' tab
  4. Scroll down and click on 'Save Changes'
  5. See error "Failed to update user trait"

Expected behavior
User can update their profile information without error.

Screencast

Screencast.2021-07-09.23-38-34.mp4

Desktop (please complete the following information):

  • OS: macOs
  • Browser: Chrome latest

Additional context
Not only "Basic Info" tab, also "Language, Education ..." are not working on newly created accounts.

@luizrrodrigues
Copy link
Collaborator

@urwithat Can you take a look in this one please?

@urwithat
Copy link
Contributor

@LieutenantRoger - I'm used the following curl don't see an error:

curl --location --request GET 'https://api.topcoder.com/v3/members/customeruser/traits'
--header 'Authorization: Bearer token'

Has something been changed?

@luizrrodrigues
Copy link
Collaborator

@urwithat The request need be PUT to update profile information:

image

@SathyaJayabal
Copy link
Collaborator

@urwithat , looks like the issue is with the work traits data for this specific user. (handle: CustomerUser). If possible can you clear that info from the DB for this user.

cc @lakshmiathreya @luizrrodrigues

@urwithat
Copy link
Contributor

@luizrrodrigues - Thanks for pointing out the pout request.
I see the member's work trait is not correctly formatted.

This is the current data for work trait:

{
  "categoryName": "Work",
  "createdAt": "2020-11-10T08:12:18.279Z",
  "createdBy": 41000101,
  "traitId": "work",
  "traits": "{\"traitId\":\"work\",\"data\":[{\"company\":\"New company\",\"position\":\"Architect\",\"cityTown\":\"Mumbai\",\"timePeriodFrom\":\"2016-09-12T06:30:00.000Z\",\"industry\":\"Banking\",\"working\":true,\"jobDescription\":\"<p><strong>Test</strong></p>\\n<p><em>New test description</em></p>\\n<p><u><em>Points to consider</em></u></p>\",\"jobAchievements\":\"<p><u>Achievements within role</u></p>\\n<p><u><em>New role</em></u></p>\\n<p><u><em><strong>Newer role</strong></em></u></p>\",\"technologies\":[{\"id\":7,\"name\":\"Applet\"},{\"id\":35,\"name\":\"ASP.NET Core \"},{\"id\":419,\"name\":\"Apriori\"}]},{\"company\":\"New\",\"working\":false}]}",
  "updatedAt": "2020-11-10T09:47:44.255Z",
  "updatedBy": 41000101,
  "userId": 41000101
}

Have cleaned it up to:

{
  "categoryName": "Work",
  "createdAt": "2020-11-10T08:12:18.279Z",
  "createdBy": 41000101,
  "traitId": "work",
  "traits": "{\"traitId\":\"work\",\"data\":[{\"company\":\"New company\",\"position\":\"Architect\",\"cityTown\":\"Mumbai\",\"timePeriodFrom\":\"2016-09-12T06:30:00.000Z\",\"industry\":\"Banking\",\"working\":true}]}",
  "updatedAt": "2020-11-10T09:47:44.255Z",
  "updatedBy": 41000101,
  "userId": 41000101
}

This has fixed the issue of data corruption for member customeruser

@nursoltan-s @luizrrodrigues - can you help me understand how the following details were added to the work trait as the frontend does not support the attributes: jobDescription, jobAchievements, technologies!

Seems like someone has been adding details via curl commands. Kindly let me know the root cause of this issue if known.

@SathyaJayabal
Copy link
Collaborator

SathyaJayabal commented Jul 12, 2021

@urwithat , there was a requirement , and we had tested this but it did not go to prod and it is on hold. This data was added while testing that feature on staging (prod BE)
#4659

@urwithat
Copy link
Contributor

@SathyaJayabal - Thanks for the information, I could not recollect the older req.
Hope this sorts out the issue since we have not pushed the new code in production! or do we need to look into something?

@SathyaJayabal
Copy link
Collaborator

@urwithat , we just needed that data cleaned up. can u just remove that trait altogether for the user please? i still see some error while adding a work.

@SathyaJayabal
Copy link
Collaborator

@urwithat , thank you data is good now
cc @nursoltan-s @luizrrodrigues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants