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
Inconsistent handling of user ID in user data fetching functions
Expected Behavior
All user data fetching functions should consistently handle the user ID by overriding any existing id field in the user data with the document ID.
Current Behavior
Currently, five functions that fetch user data (fetchUser, fetchUserByIds, fetchPaginatedUsers, getDiscordUsers, and fetchAllUsers) handle the user ID inconsistently. Some may include both the document ID and a potentially conflicting id field from the user data.
Screenshots
N/A
Reproducibility
This issue is reproducible
This issue is not reproducible
Steps to Reproduce
Examine the following functions in models/users.js:
fetchUser
fetchUserByIds
fetchPaginatedUsers
getDiscordUsers
fetchAllUsers
Observe how each function handles the user ID when constructing the returned user object.
Severity/Priority
Critical
High
Medium
Low
Additional Information
The issue can be resolved by ensuring that in all five functions, the document ID is assigned to the id field after spreading the user data. For example:
return{
...userData,id: documentId,};
This approach will ensure that the document ID always overrides any existing id field in the user data.
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:
Issue Description
Inconsistent handling of user ID in user data fetching functions
Expected Behavior
All user data fetching functions should consistently handle the user ID by overriding any existing
id
field in the user data with the document ID.Current Behavior
Currently, five functions that fetch user data (
fetchUser
,fetchUserByIds
,fetchPaginatedUsers
,getDiscordUsers
, andfetchAllUsers
) handle the user ID inconsistently. Some may include both the document ID and a potentially conflictingid
field from the user data.Screenshots
N/A
Reproducibility
Steps to Reproduce
models/users.js
:fetchUser
fetchUserByIds
fetchPaginatedUsers
getDiscordUsers
fetchAllUsers
Severity/Priority
Additional Information
The issue can be resolved by ensuring that in all five functions, the document ID is assigned to the
id
field after spreading the user data. For example:This approach will ensure that the document ID always overrides any existing
id
field in the user data.Checklist
The text was updated successfully, but these errors were encountered: