By default, every developer has the status "ONBOARDING" in the database once they join the Discord server. This onboarding status should ideally be removed within a month. If not, then we have a Discord role, i.e., group-onboarding-31d+, for it to be applied. There's a button on the status site to sync "onboarding 31d+" users, but it doesn't add that role to the matched user. The issue lies in the verification flow. Once the user runs the /verify command, we do not send the discordJoinedAt field, which is required for this role to be applied.
Phase 1
A quick fix would be to use a deprecated API which is /external-accounts/discord-sync which will store the discordJoinedAt into the user collection. It includes following things to be done:
Instead of updating the entire user info, use specific query to update the specific user details.
Update the test cases
Phase 2
The current solution is to fix the existing flow and add discordJoinedAt to the users who do not have this key. For this, it requires 2 things to be done
Storing discordJoinedAt while generating the verification token
Instead of providing discordId from frontend once the user authorises the discord bot, we should update the user details in backend itself.
Expected Behavior
group-onboarding-31d+ should be applied to all the applicable users
Updating user info once the verification is completed should be handled in backend instead of making PATCH API to /users/self route.
Current Behavior
group-onboarding-31d+does not get applied to the applicable users
my-site makes a PATCH request to /users/self with discordId in the body once the verification is completed. Updating users info based on data provided by the frontend is not recommended.
Screenshots
NA
Reproducibility
[x] This issue is reproducible
[ ] This issue is not reproducible
Steps to Reproduce
Create a fresh signup
Run /verify command
Verify your account using the same link
Validate that discordJoinedAt is missing from user collection
Severity/Priority
[x] Critical
[ ] High
[ ] Medium
[ ] Low
Additional Information
NA
Checklist
[x] I have read and followed the project's code of conduct.
[x] I have searched for similar issues before creating this one.
[x] I have provided all the necessary information to understand and reproduce the issue.
[x] I am willing to contribute to the resolution of this issue.
Issue Description
By default, every developer has the status "ONBOARDING" in the database once they join the Discord server. This onboarding status should ideally be removed within a month. If not, then we have a Discord role, i.e.,
group-onboarding-31d+
, for it to be applied. There's a button on the status site to sync "onboarding 31d+" users, but it doesn't add that role to the matched user. The issue lies in the verification flow. Once the user runs the/verify
command, we do not send thediscordJoinedAt
field, which is required for this role to be applied.Phase 1
A quick fix would be to use a deprecated API which is
/external-accounts/discord-sync
which will store the discordJoinedAt into the user collection. It includes following things to be done:Phase 2
The current solution is to fix the existing flow and add
discordJoinedAt
to the users who do not have this key. For this, it requires 2 things to be donediscordId
from frontend once the user authorises the discord bot, we should update the user details in backend itself.Expected Behavior
group-onboarding-31d+
should be applied to all the applicable users/users/self
route.Current Behavior
group-onboarding-31d+
does not get applied to the applicable usersmy-site
makes a PATCH request to/users/self
with discordId in the body once the verification is completed. Updating users info based on data provided by the frontend is not recommended.Screenshots
NA
Reproducibility
Steps to Reproduce
/verify
commanddiscordJoinedAt
is missing from user collectionSeverity/Priority
Additional Information
NA
Checklist