-
Notifications
You must be signed in to change notification settings - Fork 1
Timer backend #276
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
base: master
Are you sure you want to change the base?
Timer backend #276
Conversation
|
[diff-counting] Significant lines: 679. |
… to events to frontend, change tests to skip websocket operations
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.
This looks very solid! One thing I'm wondering is that we’re currently hardcoding business rules like 5 min extension and 25% point deduction in the service. Could we move those into named constants instead of inlining them? That way we can tweak the values without touching logic and we avoid drift if we update one place and forget another. Overall, amazing job amber!
Summary
This pull request implements the backend of the timer feature for Challenges. Challenges may have timers of certain lengths; if so, then each user completing the challenge has their own timer associated with them and that challenge. The timer should be started once the challenge is started, and the challenge should end once the timer ends.
Timers have milestones, at which warnings are sent to the user (ex. 30 seconds left). They can be extended, and when a timer is extended 25% of the user's score if they were to complete the challenge without a timer is deducted. Timers are found through the challengeId and userId associated with each timer.
Remaining TODOs:
Test Plan
Breaking Changes