test: cover Humans Vs Nations buckets in the profile stats tree schema - #4904
test: cover Humans Vs Nations buckets in the profile stats tree schema#4904evanpelle wants to merge 1 commit into
Conversation
Production profiles with HvN games failed the whole PlayerProfileSchema parse until #4873 widened the stats record key beyond z.enum(GameMode). Pin that behavior: HvN buckets under Public/Private parse (the exact failing prod payload shape), and unknown mode keys are still rejected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe PR adds ChangesPlayer profile schema tests
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
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. Comment |
Summary
Regression tests for the production parse failure where
fetchPlayerByIdrejected any profile carrying Humans vs Nations games:The API buckets HvN games under a
"Humans Vs Nations"key in the profile stats tree, butGameModeStatsSchemaused to key the record withz.enum(GameMode)(onlyFree For All/Team), so the whole profile parse failed and the profile came up empty. #4873 already fixed the schema by introducingPlayerStatsGameModes; this PR pins that behavior so it can't regress:"Humans Vs Nations"buckets underPublicandPrivate(the exact failing prod payload shape) parses, and the leaf bigints come through"Battle Royale") is still rejectedTest plan
npx vitest tests/ApiSchemas.test.ts --run— 131 passed🤖 Generated with Claude Code