Repository navigation
fix(profile): expose LongestStreak on GET /api/profile for free-tier streak - #213
Merged
Merged
Conversation
…streak The streak detail page's "longest" stat read the Pro-gated GET /api/gamification/streak, so free users always saw 0. Expose the already-stored user.LongestStreak on the ungated /api/profile endpoint. Additive and backward-compatible (new response field). - ProfileResponse gains LongestStreak. - Add GetProfileQueryHandler test; update MCP ProfileTools test ctor. Partial pull-forward of #186 (free-tier entitlement rebalance). Paired with orbit-ui-mobile fix/streak-free-tier. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Clean, minimal fix. LongestStreak is already stored on User and maintained by streak logic — this PR simply plumbs it through ProfileResponse so free-tier clients get the real value from the ungated GET /api/profile endpoint instead of reading the Pro-gated gamification route. The change is purely additive (new response field), the new handler test exercises both streak values end-to-end, and the MCP test constructor is correctly updated. No correctness, security, or contract issues found.
|
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.



What
Free users saw
0for their longest streak ("Maior") because the streak detail page read the Pro-gatedGET /api/gamification/streak. This exposes the already-storeduser.LongestStreakon the ungatedGET /api/profile, so free users get their real longest streak.Why
Per #186 / #196, streak (current + longest) is intended to be a free feature; only the freeze/insights system stays Pro.
currentStreakwas already on/api/profile;longestStreakwas not. Additive and backward-compatible (new response field).Changes
ProfileResponsegainsLongestStreak(fromuser.LongestStreak).GetProfileQueryHandlertest asserting current + longest.ProfileToolstest constructor updated.Tests
Orbit.Application.Tests(126) +Orbit.Infrastructure.Tests(17) pass; builds clean.Deploy order
Merge/deploy this before the client depends on the field. Clients read it defensively (
?? 0), so an early client deploy degrades to0rather than crashing.Paired PR
Frontend: thomasluizon/orbit-ui-mobile#248
Partial pull-forward of #186.
🤖 Generated with Claude Code