fix(milestone): gate mock contributors fallback in getFullMilestoneData behind dev environment - #308
Conversation
…ta behind dev environment
|
@AugistineCreates is attempting to deploy a commit to the Threadflow Team on Vercel. A member of the Team first needs to authorize it. |
|
@AugistineCreates Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIn ChangesMock contributor gating
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
This pr closes #278
This PR gates the fallback to
MOCK_MODEL4_CONTRIBUTORSinsidegetFullMilestoneDatato prevent mock/demo user accounts (such as Alice, Bob, David) from leaking to public or unauthenticated visitors in production milestone funnels.MOCK_MODEL4_CONTRIBUTORSfallback insidegetFullMilestoneDataincomponents/bounty-detail/bounty-detail-client.tsxbehind a check forprocess.env.NODE_ENV === "development".contributorProgress, it now correctly falls back to an empty array[]instead of mock contributor data.Call Site Audit Summary
getFullMilestoneDatain the codebase:bounty.type === "MULTI_WINNER_MILESTONE" && session?.user?.id, which requires the user to be authenticated.bounty.type === "MULTI_WINNER_MILESTONE" && session?.user?.id === bounty.createdBy, which also requires the user to be authenticated.MilestoneFunnel) correctly usesgetRealContributors(bounty)directly (which does not fall back to mocks), meaning there is no risk of leaking mock data to public visitors.