Skip to content

fix: add missing 14-day streak milestone - #2293

Merged
KaranUnique merged 1 commit into
Canopus-Labs:mainfrom
Suprita736:fix/2290-14-day-streak-achievement
Aug 31, 2026
Merged

fix: add missing 14-day streak milestone#2293
KaranUnique merged 1 commit into
Canopus-Labs:mainfrom
Suprita736:fix/2290-14-day-streak-achievement

Conversation

@Suprita736

@Suprita736 Suprita736 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

📝 Pull Request Description

Related Issue

Closes #2290

Summary

Added the missing 14-day streak milestone so the existing "14-Day Streak" achievement can be unlocked when a user reaches a 14-day consecutive streak.

Also added unit test coverage for the 14-day streak milestone while preserving the existing 3-day, 7-day, and 30-day streak behavior.


Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature
  • ♻️ Refactoring
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • 🔥 Other(please describe) ______

How Has This Been Tested?

  • Added unit test coverage for the 14-day streak milestone.
  • Verified that reaching a 14-day streak unlocks the existing "14-Day Streak" achievement.
  • Verified that the existing 3-day, 7-day, and 30-day streak milestones remain unchanged.
  • Ran the relevant streak tracker tests successfully.

Screenshots (if applicable)

Not applicable — this is a backend logic and test coverage fix.


Checklist

  • My code follows the project's guidelines
  • I have tested my changes
  • I have updated documentation where necessary
  • I have linked the related issue
  • My changes do not introduce new warnings or errors

Adds the missing 14-day streak milestone.

Updates include:

  • Adds the "14-Day Streak" milestone in backend/utils/streakTracker.js.
  • Adds unit tests for 3-, 7-, 14-, and 30-day streak achievements.
  • Verifies duplicate achievements are not added.
  • Verifies UTC day differences and missed-streak resets.

@github-actions

Copy link
Copy Markdown

Thank you for submitting your pull request, @Suprita736! 🙌
We'll review it as soon as possible.
If there are any specific instructions or feedback regarding your PR, we'll provide them here.
Thanks again for your contribution to our project! 😊

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c8302ce-3a29-4fa0-88d8-9e3da6288fd7

📥 Commits

Reviewing files that changed from the base of the PR and between 23d4b29 and 9a57aee.

📒 Files selected for processing (2)
  • backend/tests/streakTracker.unit.test.js
  • backend/utils/streakTracker.js

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The streak tracker now includes the 14-day achievement milestone. A new Vitest suite tests milestone unlocking, duplicate prevention, UTC day differences, and streak resets after missed practice.

Changes

Streak milestone coverage

Layer / File(s) Summary
14-day milestone and streak behavior tests
backend/utils/streakTracker.js, backend/tests/streakTracker.unit.test.js
The tracker adds the 14-Day Streak milestone. Tests cover 3-, 7-, 14-, and 30-day achievements, duplicate prevention, UTC day differences, and missed-practice resets.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 9a57a

This change enables the existing 14-day streak achievement while preserving the other streak milestones and adds targeted test coverage. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: torqued-codes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding the missing 14-day streak milestone.
Linked Issues check ✅ Passed The pull request adds the 14-day milestone to restore the required 3 → 7 → 14 → 30 progression and adds unit tests for the milestone and existing streak behavior. This satisfies issue #2290.
Out of Scope Changes check ✅ Passed The changes are limited to the streak milestone configuration and related unit tests. No unrelated changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Some tools did not complete. Review the errors below.

🔧 Biome (2.5.7)
backend/tests/streakTracker.unit.test.js

File contains syntax errors that prevent linting: Line 1: Illegal use of an import declaration outside of a module


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the merge ready PR is mergeable and has no conflicts label Aug 31, 2026
@KaranUnique
KaranUnique merged commit ecb5cef into Canopus-Labs:main Aug 31, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "14-Day Streak" achievement is unreachable

2 participants