Description
The backend function checkHotStreak evaluates the HOT_STREAK badge using an active snapshot array slice (history.slice(-8)) that includes today's incomplete dataset. Because it requires strict daily increment comparison against the previous day (todayTotals - yesterdayTotals < 1), it forces a user's streak to drop or remain invisible for the majority of the day until they solve an additional problem on that specific calendar day.
The Problem
If a user solves a problem every single day for 7 days straight, their streak is technically valid. However, when the backend calculation runs at any point during "today":
todayTotals will equal yesterdayTotals because the user hasn't completed/logged a new problem yet on this current calendar day (e.g., they plan to solve it at 9:00 PM).
- The condition
if (todayTotals - yesterdayTotals < 1) evaluates to true.
- The loop triggers
consecutiveDaysMet = false and breaks, stripping away or withholding their earned badge.
This leaves users with a tiny window of time to actually "feel" or see their badge. For example, if a user finishes their daily problem at 11:00 PM, they will only have the badge visible on their profile for exactly 1 hour before midnight resets the snapshot and breaks the conditional math again.
Proposed Solution
Modify the backend tracking logic to look at the last 7 fully completed days (ignoring today's live/incomplete snapshot), or adjust the math parameters to allow a grace window for the current calendar day's total so users aren't penalized for not completing a problem first thing in the morning.
would like to work on this !!!
Description
The backend function
checkHotStreakevaluates theHOT_STREAKbadge using an active snapshot array slice (history.slice(-8)) that includes today's incomplete dataset. Because it requires strict daily increment comparison against the previous day (todayTotals - yesterdayTotals < 1), it forces a user's streak to drop or remain invisible for the majority of the day until they solve an additional problem on that specific calendar day.The Problem
If a user solves a problem every single day for 7 days straight, their streak is technically valid. However, when the backend calculation runs at any point during "today":
todayTotalswill equalyesterdayTotalsbecause the user hasn't completed/logged a new problem yet on this current calendar day (e.g., they plan to solve it at 9:00 PM).if (todayTotals - yesterdayTotals < 1)evaluates totrue.consecutiveDaysMet = falseand breaks, stripping away or withholding their earned badge.This leaves users with a tiny window of time to actually "feel" or see their badge. For example, if a user finishes their daily problem at 11:00 PM, they will only have the badge visible on their profile for exactly 1 hour before midnight resets the snapshot and breaks the conditional math again.
Proposed Solution
Modify the backend tracking logic to look at the last 7 fully completed days (ignoring today's live/incomplete snapshot), or adjust the math parameters to allow a grace window for the current calendar day's total so users aren't penalized for not completing a problem first thing in the morning.
would like to work on this !!!