Skip to content

[#1239] Add Farcaster follow verification (verifyFc)#1277

Merged
realproject7 merged 1 commit into
mainfrom
task/1239-activation-verify-fc
May 26, 2026
Merged

[#1239] Add Farcaster follow verification (verifyFc)#1277
realproject7 merged 1 commit into
mainfrom
task/1239-activation-verify-fc

Conversation

@realproject7

Copy link
Copy Markdown
Owner

Summary

  • Creates lib/airdrop/activation-verify.ts with verifyFc(username, plotlinkFid)
  • Two Neynar API calls: (1) GET /user/by_username → FID, (2) GET /user/bulk?viewer_fid → follow check
  • Returns { ok: true, fid } on success, or { ok: false, error } with user_not_found / not_following / neynar_error
  • No DB writes — caller endpoint handles persistence
  • 9 unit tests: success, 404, 400, no-fid, not-following, 5xx on both calls, network failure, missing API key

Version

1.30.3 → 1.30.4

🤖 Generated with Claude Code

Neynar wrapper for Farcaster follow verification: looks up user by
username to get FID, then checks if they follow the PlotLink account.
Returns typed ok/error result with user_not_found, not_following, or
neynar_error. No DB writes. 9 unit tests cover all paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored May 26, 2026 5:32am

Request Review

@realproject7 realproject7 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@re2 review — APPROVE ✅

Checked against issue #1239 acceptance criteria:

Criterion Status
User-not-found → { ok: false, error: 'user_not_found' } ✅ (404, 400, missing fid)
Not-following → { ok: false, error: 'not_following' } ✅ (no partial DB write)
Following → { ok: true, fid }
Neynar 5xx → neynar_error ✅ (both API calls)
No DB writes in this lib ✅ (no Supabase imports)
Version bump 1.30.3 → 1.30.4 (patch)

Code review notes:

  • Two-step Neynar flow correct: (1) username→FID lookup, (2) bulk user fetch with viewer_fid to check follow status via viewer_context.following.
  • encodeURIComponent() on username prevents injection. API key passed via header.
  • Both API calls wrapped in separate try/catch — network failures on either call gracefully return neynar_error.
  • Missing API key returns error result (not throw) — consistent with R16 graceful degradation philosophy for this function.
  • Discriminated union return type with specific error strings is clean for caller branching.
  • 9 tests cover all paths including both 5xx scenarios, network failure, and missing key.

No issues found.

@project7-interns project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verdict: APPROVE

Summary

The PR satisfies #1239: verifyFc performs the username lookup, checks the PlotLink follow relationship through Neynar viewer context, returns the required typed success/error results, and does not write to the database. Tests cover user-not-found, not-following, following, Neynar 5xx, network failure, missing API key, and no-FID response.

Findings

  • No blocking findings.

Decision

Approve. lint-and-typecheck is passing; e2e was still pending at review time, so merge should still wait for required CI to complete successfully.

@realproject7
realproject7 merged commit 0eebaab into main May 26, 2026
4 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.

2 participants