Skip to content

[#916] Fix streak tier drop logic to drop to previous tier#921

Merged
realproject7 merged 1 commit intomainfrom
task/916-streak-tier-drop-logic
Apr 21, 2026
Merged

[#916] Fix streak tier drop logic to drop to previous tier#921
realproject7 merged 1 commit intomainfrom
task/916-streak-tier-drop-logic

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • dropOneTier() was snapping to the current tier threshold instead of the previous one
  • streak 50 + miss → stayed at 50 (no penalty). Now correctly drops to 30
  • streak 100 + miss → stayed at 100. Now correctly drops to 50
  • streak 7 + miss → stayed at 7. Now correctly drops to 0
  • streak 3 + miss → already returned 0 (unchanged)
  • Updated comment in checkin route to match new behavior
  • Bumps patch version to 0.1.30

Fixes #916

Test plan

  • Verify dropOneTier(100) returns 50
  • Verify dropOneTier(50) returns 30
  • Verify dropOneTier(7) returns 0
  • Verify dropOneTier(3) returns 0
  • Check-in flow: miss a day with streak 50, confirm streak drops to 30

🤖 Generated with Claude Code

dropOneTier was snapping to the current tier threshold instead of dropping
to the one below. E.g. streak 50 stayed at 50 instead of dropping to 30.

Fixed: streak now drops to previous tier (100→50, 50→30, 30→14, 14→7, 7→0).

Fixes #916

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored Apr 21, 2026 10:01am

Request Review

@realproject7
Copy link
Copy Markdown
Owner Author

re2 Review — APPROVED ✅

Verified against TIER_THRESHOLDS = [7, 14, 30, 50, 100]:

Input Old (buggy) New (fixed) Expected
100 100 50 50 ✓
50 50 30 30 ✓
30 30 14 14 ✓
7 7 0 0 ✓
3 0 0 0 ✓

The fix is a single index shift: TIER_THRESHOLDS[i]TIER_THRESHOLDS[i - 1] with a bounds check. Comment in checkin route updated to match. Patch bump 0.1.30 ✓

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

This PR corrects dropOneTier() to drop to the previous streak threshold instead of snapping to the current one. The implementation now matches issue #916's stated behavior for 100, 50, 7, and sub-7 streaks.

Findings

  • None.

Decision

Approve. I verified the threshold ordering and the updated logic now yields the intended tier drops. CI checks were still pending at review time.

@realproject7 realproject7 merged commit 18e6394 into main Apr 21, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Airdrop] Verify streak tier drop logic matches spec

2 participants