RealDevSquad / RealDevSquad/website-backend

Wrong and hardcoded group idle role Id in models/discordActions.js

Open Beginner friendly
#2,064 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
74
Forks
276
Avg merge
1d 26m
Merged PRs (30d)
14

Description

Issue Description

In the updateIdleUsersOnDiscord method of models/discordActions.js, we have hardcoded the group idle roleId in lines 387,393.
Idle role Id from discord - 1147354535342383104
Id mentioned in code - 1153280659004080148

https://github.com/Real-Dev-Squad/website-backend/blob/72d8f08bdb05db8f4d91f83683bf2f789027e318/models/discordactions.js#L387
https://github.com/Real-Dev-Squad/website-backend/blob/72d8f08bdb05db8f4d91f83683bf2f789027e318/models/discordactions.js#L393

This part of the updateIdleUsersOnDiscord function is used to update the member-group-roles collection in firebase consisting of the member and its corresponding discord roles data. The logic of updating the idle user in discord does not use this table though.

Expected Behavior

The role Id should not be hardcoded. Refer https://github.com/Real-Dev-Squad/website-backend/blob/72d8f08bdb05db8f4d91f83683bf2f789027e318/models/discordactions.js#L420 for expected behavior.

Current Behavior

The groupIdleRole Id is hardcoded.

Screenshots
Reproducibility
  • This issue is reproducible
  • This issue is not reproducible
Steps to Reproduce
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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in models/discordActions.js, especially updateIdleUsersOnDiscord and the hardcoded role IDs at lines 387 and 393. Compare those paths with the expected behavior referenced near line 420, then verify that member-group-roles data uses the correct non-hardcoded group idle role ID without changing the Discord idle-user update behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.