Player profile level grows unboundedly: addXp and recordMatch have no level cap #65
Labels
No labels
blocked:lint-failed
blocked:needs-decision
blocked:no-changes
bug
feature-request
in-progress
milestone
ops-task
quickfix
security/high
test-coverage
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/chainbound#65
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Both addXp (src/data/profile.ts:156) and recordMatch (line 184) have level-up loops with no upper bound. A long-running player profile can reach level 1000+. Ranks plateau (Diamond at level 20+) but the level number keeps growing.
Where
Why this matters
Acceptance criteria
Fixed in commit
8f33946onmain.Changes:
MAX_LEVEL = 100constant insrc/data/profile.tsapplyLevelUps()used by bothaddXpandrecordMatch; terminates at MAX_LEVEL and retains excess XP for displayProfileScreenXP bar now shows "N XP toward Prestige" once capped instead of the previous "MAX" label that fired at the rank plateausrc/data/profile.test.tscovering MAX_LEVEL constant, level cap, excess XP retention across multiple calls, andrecordMatchat maxAll 7 new tests pass; full suite unchanged except 3 pre-existing failures in
src/engine/reactiveConditions.test.ts(verified againstmainbefore this change).