Earn streak freezes after 7 consecutive days - #151
Merged
Conversation
- Add StreakFreezesAccumulated + LastFreezeAwardStreak to User entity with AwardStreakFreezeIfEligible (max 3 banked) and ConsumeStreakFreeze - Hook UserStreakService to award a freeze on every 7-day streak milestone - Rewrite ActivateStreakFreezeCommand: reject when accumulated <= 0, reject when calendar-month usage hits max (3), consume from bank - Extend StreakInfoResponse with accumulated count, daysUntilNextFreeze, freezesAvailableToUse, canEarnMore - Migration AddStreakFreezeAccumulation adds the two int columns Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19a5b2004c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
StreakInfoResponse and StreakFreezeResponse gained new fields (StreakFreezesAccumulated and related) for the earning feature; update the two test call sites so the build compiles. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SetStreakState only cleared LastFreezeAwardStreak when the recalculated streak was exactly 0, but the recalc commonly jumps from a prior streak (e.g., 14) directly to 1 when the user logs again after a missed day. The stale marker then made AwardStreakFreezeIfEligible treat new 7-day runs as already awarded and withhold freezes until the user surpassed the previous milestone (21 instead of 7), and DaysUntilNextFreeze drifted along with it. Trigger the reset whenever the new streak is lower than the old one, which covers both 14 -> 0 and 14 -> 1 restarts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Matches the frontend PR in orbit-ui-mobile (shared schema expects the new fields).
Test plan
🤖 Generated with Claude Code