Conversation
- GET /api/airdrop/status — campaign overview, milestones, mcap, totals - GET /api/airdrop/points?address= — user breakdown, streak, referral, estimated airdrop - GET /api/airdrop/leaderboard?address= — top 50 by points with optional user rank - GET /api/airdrop/snapshots — weekly campaign stats history Fixes #885 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The endpoint set is close, but the campaign overview response currently reports incorrect summary data in at least two cases.
Findings
- [medium]
totalParticipantsis counting point rows, not unique participant addresses. As soon as one user earns multiplepl_pointsentries,/api/airdrop/statuswill over-report participant count relative to the ticket's campaign overview requirement.- File:
src/app/api/airdrop/status/route.ts:40 - Suggestion: count distinct addresses (or aggregate unique addresses first) instead of using a raw row count on
pl_points.
- File:
- [medium]
timeElapsedPercentis not capped at 100, so once the campaign end date passes the endpoint can return values above 100. That makes the status response internally inconsistent for the ended-campaign state.- File:
src/app/api/airdrop/status/route.ts:20 - Suggestion: clamp elapsed time to
totalMsbefore computing the percentage, or explicitly cap the returned percent at 100.
- File:
Decision
Requesting changes because /api/airdrop/status currently returns incorrect campaign summary values for participant count and post-end elapsed percent.
Use Set-based dedup instead of row count to get unique participant count. Also simplified total points calculation into single query. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The participant-count issue is fixed, but one of the two correctness problems from my previous review remains unresolved.
Findings
- [medium]
timeElapsedPercentis still computed from unclamped elapsed time, so afterCAMPAIGN_ENDthe endpoint can still return values above 100.- File:
src/app/api/airdrop/status/route.ts:19 - Suggestion: clamp elapsed time to the campaign duration (or cap the returned percentage at 100) before serializing the response.
- File:
Decision
Requesting changes because /api/airdrop/status can still return an invalid elapsed percentage after campaign end.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The /api/airdrop/status fixes are now in place: participant count is based on unique addresses and timeElapsedPercent is capped at 100 for post-campaign responses. The endpoint set otherwise matches the ticket scope.
Findings
- No blocking findings in the updated patch.
Decision
Approving from a code-review standpoint. The blockers from my previous reviews are resolved, and I do not see a remaining PR-specific code issue.
Summary
Files Changed
src/app/api/airdrop/status/route.tssrc/app/api/airdrop/points/route.tssrc/app/api/airdrop/leaderboard/route.tssrc/app/api/airdrop/snapshots/route.tsTest plan
Fixes #885
🤖 Generated with Claude Code