bugFix : onboarding-31-days
Opened this issue · 0 comments
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 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 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
- 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
- Critical
- High
- Medium
- Low
Additional Information
NA
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.