-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bailey new personal max backend #619
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @BaileyM96, I tested this pr and found everything to work well. Changing the cronjob's running period allowed the badges to remove duplicates and update the personal max hrs appropriately. It took a few page refreshes to see it work but that makes sense from the cronjob running every minute.
One thing I additionally did was comment out 527 -531 in the userProfileController.js file, this was just so caching wouldn't get in the way of the immediate update.
Only thing I would suggest is to remove unneeded console.logs.
clip.3.3.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @BaileyM96.
I tested your PR and works as intended. Great work!
I modified, the personalBestMaxHrs and lastWeekTangibleHrs on the backend to 20. I then ran npm run build && npm start
Lastly, I did a hard refresh and showed up immediately, however, i still ran empty cache and worked as intended. The badge updated to 22 on the dashboard page and in the user's profile as well.
Screen.Recording.2023-11-26.at.7.59.12.PM.mov
Regardless, I agree with Roberto to remove any console.logs.
Overall great work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -51,6 +51,7 @@ async function ValidatePassword(req, res) { | |||
} | |||
|
|||
const userProfileController = function (UserProfile) { | |||
console.log('Hello') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should remove console.log statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ptrpengdev I went through and removed the remaining console logs that you mentioned :) Please let me know if i missed anything else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. Please do remember to pull the latest code from the development branch and resolve any conflicts. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @BaileyM96 ,
Great job on this task! Your code changes seem to work as intended. After changing personalBestMaxHrs to a value greater than 10, running the backend server, and hard refreshing, the changes to the personal max hours appear on the test account's profile page.
bailey.personal.max.demo.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the console log from the code before merging. The badge collection update functions are missing the step of adding the new earned date, which will lead to a mismatch for the count and earned dates. I have mentioned this to Jae and will create a fix for it. Other than that, the code works as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
The badge should just update the number next to it AND on it, and not be awarded again in the list shown below.
Every time the record is broken though, it should still show up in the New Badges section of the person’s Dashboard
Related PRS (if any):
None
Main changes explained:
How to test:
npm install
to run this PR locallynpm run build && npm start
This ensures the changes for the cronjob go into affect so it will run right away.Screenshots or videos of changes:
Walkthrough of how to test the back end.
Personal Max Testing Guide.webm
The fields to change in the MongoDB database
Note:
The badge only awards on Sundays, this testing method just helps award the badge right away to make sure the badge does not duplicate.
When awarding the badge right away it will not appear under new badges until Sunday and the count of the badges inside the report badges will not update until Sunday as well.