You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PATCH /users/self is going to be deprecated` but the controller logic stays.
The Patch /users/self routes, doesn't allow the developers to update their profile data.
By developers we mean those users who are in the discord server, whom user Details is not incomplete and have developers role added to them.
For user to update their profile data we suggest them to use Profile service.
we are fetching all the user in RDS server from the discord, in order to check if the user has developer role or not , using the discord service, this shoots up the response time in certain cases, the latency is in magnitude of O(n) where n is the number of users currently in the discord service
Expected Behaviour
If a request is made to the route PATCH /users/self with some data in the body: partial<UserObject> it is the expectation that it should update user data with all that is being sent in the body .
Fast Response Time
Current Behaviour
If we send a request with object
body: {username:string}
it return can't update the username twice -> expected
body:{roles:{super_user: true/false}}
it return can't modify roles --> expected
For other properties we don't allow users to update their profile data, if the user is a developer, (in_discord==true && !userDetailsIncomplete). then we fetch all the user from discrod server and check if the current logged in users discordId is equal to the discord.user.id. in worst case this the it take up to O(n) time if the user returned is found to be at end.
ps: this route is generally used to add details to user once they are signed up or has their userDetailsIncomplete property true.
Flow
Reproducibility
This issue is reproducible
This issue is not reproducible
Steps to Reproduce
send the objects mentioned in current behavior section on PATCH /users/self.
Severity/Priority
Critical
High
Medium
Low
Additional Information
Checklist
I have read and followed the project's code of conduct.
I have searched for similar issues before creating this one.
I have provided all the necessary information to understand and reproduce the issue.
I am willing to contribute to the resolution of this issue.
The text was updated successfully, but these errors were encountered:
shubhdevelop
changed the title
The PATCH /users/self route is ambiguous
[fix] The PATCH /users/self route is ambiguous, and high response time.
Sep 20, 2024
shubhdevelop
changed the title
[fix] The PATCH /users/self route is ambiguous, and high response time.
The PATCH /users/self route is ambiguous, and high response time.
Sep 20, 2024
ankushdharkar
changed the title
The PATCH /users/self route is ambiguous, and high response time.
PATCH /users/self route is ambiguous and slow
Sep 20, 2024
shubhdevelop
changed the title
PATCH /users/self route is ambiguous and slow
The PATCH /users/self route is ambiguous, and slow.
Sep 20, 2024
ankushdharkar
changed the title
The PATCH /users/self route is ambiguous, and slow.
PATCH /users/self route is ambiguous, and slow.
Sep 20, 2024
shubhdevelop
changed the title
PATCH /users/self route is ambiguous, and slow.
The /users/self route is ambiguous, and slow.
Sep 20, 2024
ankushdharkar
changed the title
The /users/self route is ambiguous, and slow.
PATCH /users/self route is ambiguous, and slow.
Sep 20, 2024
shubhdevelop
changed the title
PATCH /users/self route is ambiguous, and slow.
PATCH /users/self controller is ambiguous, and slow.
Sep 21, 2024
Issue Description
PATCH /users/self
is going to be deprecated` but the controller logic stays.The Patch /users/self routes, doesn't allow the
developers
to update their profile data.By
developers
we mean those users who are in the discord server, whom user Details is not incomplete and have developers role added to them.For user to update their profile data we suggest them to use Profile service.
we are fetching all the user in RDS server from the discord, in order to check if the user has developer role or not , using the discord service, this shoots up the response time in certain cases, the latency is in magnitude of O(n) where n is the number of users currently in the discord service
Expected Behaviour
If a request is made to the route
PATCH /users/self
with some data in thebody: partial<UserObject>
it is the expectation that it should update user data with all that is being sent in the body .Fast Response Time
Current Behaviour
If we send a request with object
it return can't update the username twice -> expected
it return can't modify roles --> expected
For other properties we don't allow users to update their profile data, if the user is a
developer
,(in_discord==true && !userDetailsIncomplete)
. then we fetch all the user from discrod server and check if the current logged in users discordId is equal to the discord.user.id. in worst case this the it take up to O(n) time if the user returned is found to be at end.ps: this route is generally used to add details to user once they are signed up or has their userDetailsIncomplete property true.
Flow
Reproducibility
Steps to Reproduce
send the objects mentioned in current behavior section on
PATCH /users/self
.Severity/Priority
Additional Information
Checklist
The text was updated successfully, but these errors were encountered: