Skip to content

fix(milestone): gate mock contributors fallback in getFullMilestoneData behind dev environment - #308

Merged
Benjtalkshow merged 1 commit into
boundlessfi:mainfrom
AugistineCreates:fix/gate-contributor-fallback
Jun 28, 2026
Merged

Benjtalkshow merged 1 commit into
boundlessfi:mainfrom
AugistineCreates:fix/gate-contributor-fallback

Conversation

@AugistineCreates

@AugistineCreates AugistineCreates commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

This pr closes #278

This PR gates the fallback to MOCK_MODEL4_CONTRIBUTORS inside getFullMilestoneData to prevent mock/demo user accounts (such as Alice, Bob, David) from leaking to public or unauthenticated visitors in production milestone funnels.

  • Changes:
    • Gated the MOCK_MODEL4_CONTRIBUTORS fallback inside getFullMilestoneData in components/bounty-detail/bounty-detail-client.tsx behind a check for process.env.NODE_ENV === "development".
    • Added a brief code comment explaining the purpose of gating this fallback.
    • In a production environment, if a bounty has no contributorProgress, it now correctly falls back to an empty array [] instead of mock contributor data.

Call Site Audit Summary

  • We audited all calls of getFullMilestoneData in the codebase:
    1. Milestone Submission Card (Contributor View): Rendered under bounty.type === "MULTI_WINNER_MILESTONE" && session?.user?.id, which requires the user to be authenticated.
    2. Model 4 Maintainer Dashboard (Maintainer View): Rendered under bounty.type === "MULTI_WINNER_MILESTONE" && session?.user?.id === bounty.createdBy, which also requires the user to be authenticated.
  • The public-facing Milestone Funnel (MilestoneFunnel) correctly uses getRealContributors(bounty) directly (which does not fall back to mocks), meaning there is no risk of leaking mock data to public visitors.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Bug Fixes**
  * Improved contributor progress handling so placeholder contributor data is only shown in development. In production, missing contributor progress now falls back to an empty list instead of mock data.
  * Milestone fallback behavior remains unchanged.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

@AugistineCreates is attempting to deploy a commit to the Threadflow Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e9d156df-e446-42e5-99db-dfd0d6e1d2b2

📥 Commits

Reviewing files that changed from the base of the PR and between b3ce821 and e15ff28.

📒 Files selected for processing (1)
  • components/bounty-detail/bounty-detail-client.tsx

📝 Walkthrough

Walkthrough

In getFullMilestoneData, the contributorProgress fallback now checks process.env.NODE_ENV === "development" before returning MOCK_MODEL4_CONTRIBUTORS; production builds receive an empty array instead.

Changes

Mock contributor gating

Layer / File(s) Summary
Dev-only mock fallback
components/bounty-detail/bounty-detail-client.tsx
Introduces isDev flag and gates the MOCK_MODEL4_CONTRIBUTORS fallback so it only applies in development; non-development environments fall back to [].

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • Benjtalkshow

Poem

🐇 A rabbit checked the env one day,
"Mock contributors must not stray!"
In dev they play, in prod they hide,
No Alice or Bob on the public side.
Empty array keeps the funnel true! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the change to gate the mock contributors fallback behind development mode.
Linked Issues check ✅ Passed The change addresses #278 by gating the mock fallback in production and keeping public funnels on real contributors.
Out of Scope Changes check ✅ Passed No unrelated code changes are indicated beyond the mock-contributor gating and related comment.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Benjtalkshow Benjtalkshow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@Benjtalkshow
Benjtalkshow merged commit 05441e4 into boundlessfi:main Jun 28, 2026
4 of 5 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.

Gate MOCK_MODEL4_CONTRIBUTORS fallback so demo users do not leak into the public milestone funnel

2 participants