Skip to content

fix(badges): register naija and terere as bare claimable campaigns - #2610

Merged
Hugo0 merged 1 commit into
mainfrom
hotfix/naija-terere-bare-links
Aug 5, 2026
Merged

fix(badges): register naija and terere as bare claimable campaigns#2610
Hugo0 merged 1 commit into
mainfrom
hotfix/naija-terere-bare-links

Conversation

@0xkkonrad

@0xkkonrad 0xkkonrad commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Follow-up hotfix to #2608. Both country-launch badges are live in prod but their bare campaign links do not work.

The bug

?campaign=naija and ?campaign=terere with no ?code= hit "Invalid Invite Code" instead of awarding the badge.

Mapping them in UTM_CAMPAIGN_TO_BADGE_MAP resolves the tag to a badge code, but classifyBareCampaign only bypasses the invite gate for campaigns registered in WAITLIST_SKIP_CAMPAIGNS or BARE_VANITY_CAMPAIGNS. Neither badge was in either set, so the invite flow treated the visitor as carrying an invalid invite. This is the same bug the existing comment records for touched_grass.

It matters because both cohorts get bare links with no inviter — that is the whole distribution mechanism for the Nigeria and Paraguay launches.

Why WAITLIST_SKIP_CAMPAIGNS and not BARE_VANITY_CAMPAIGNS

Both badges are in peanut-api-ts POSTLAUNCH_SKIP_BADGE_CODES. The vanity set is documented as "a commemorative badge with NO card-waitlist skip" and drives generic claim copy on /invite. Filing them there would render copy that says nothing about the queue while the backend silently granted a skip — so they belong in the skip set, which the comment already says to keep in sync with SKIP_BADGE_CODES.

Verified

  • prod DB acknowledgment_definitions has both NAIJA and TERERE seeded with the shipped copy, so the API half is deployed and healthy
  • peanut.me/badges/naija.svg and terere.svg both return 200 at the expected byte sizes
  • typecheck clean, Invites suite 49/49 including a new regression test covering both codes and their uppercase forms

Still open, not in this PR

A bare campaign claim does not set hasAppAccessFULL_BYPASS_BADGE_CODES holds only WAITLIST_SKIP and OFFRAMP_USER. Prod shows 9 users currently waiting on app access, the oldest 41.6h old, which matches the "up to 48h jail" the badge.ts comment describes for exactly this bare-link case. For an event where someone signs up and pays within minutes that is fatal, but widening the full bypass is Konrad's call, not a hotfix.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Eligible Naija and Terere country-launch campaigns now skip the waitlist.
    • Campaign matching is handled case-insensitively for these campaigns.
  • Tests

    • Added regression coverage to verify waitlist-skipping behavior.

Both country-launch links ship with no inviter. Mapping them in
UTM_CAMPAIGN_TO_BADGE_MAP was not enough: classifyBareCampaign only bypasses
the invite gate for campaigns registered in WAITLIST_SKIP_CAMPAIGNS or
BARE_VANITY_CAMPAIGNS, so a bare ?campaign=naija dead-ended on 'Invalid Invite
Code' instead of awarding the badge. Same bug that left touched_grass
unclaimable.

They go in WAITLIST_SKIP_CAMPAIGNS, not BARE_VANITY_CAMPAIGNS: both badges are
in peanut-api-ts POSTLAUNCH_SKIP_BADGE_CODES, and the vanity set is for badges
with no card-waitlist skip. Filing them as vanity would show generic claim copy
while the backend granted a skip anyway.
@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
peanut-wallet Ready Ready Preview Aug 5, 2026 1:41pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8461202b-a8e4-4a9b-81b6-ccd40ef21790

📥 Commits

Reviewing files that changed from the base of the PR and between ce141dc and bc1635c.

📒 Files selected for processing (2)
  • src/components/Invites/campaign-maps.test.ts
  • src/components/Invites/campaign-maps.ts

📝 Walkthrough

Walkthrough

The campaign map now classifies naija and terere as bare campaigns that skip the waitlist. Parameterized tests verify eligibility, waitlist handling, and case-insensitive campaign identifiers.

Changes

Campaign waitlist handling

Layer / File(s) Summary
Register country-launch campaigns
src/components/Invites/campaign-maps.ts, src/components/Invites/campaign-maps.test.ts
The campaign map adds naija and terere to WAITLIST_SKIP_CAMPAIGNS. Tests verify bare-claim eligibility, waitlist skipping, and uppercase handling.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: hugo0

🚥 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 and concisely describes registering the naija and terere campaigns as bare claimable campaigns.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/naija-terere-bare-links

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.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 6346.56 → 6346.7 (+0.14)
Findings: 0 net (+1 new, -1 resolved)

🆕 New findings (1)

  • medium complexity — src/components/Invites/campaign-maps.ts — CC 14, MI 56.19, SLOC 45

✅ Resolved (1)

  • src/components/Invites/campaign-maps.ts — CC 14, MI 56.22, SLOC 45

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 2356 ran, 0 failed, 0 skipped, 36.1s

📊 Coverage (unit)

metric %
statements 63.0%
branches 46.8%
functions 52.9%
lines 63.4%
⏱ 10 slowest test cases
time test
3.3s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
1.0s src/utils/__tests__/demo-api.test.ts › isDemoMode() is false when not running under Capacitor
0.6s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › every sticker stays within canvas at any count
0.3s src/app/(mobile-ui)/withdraw/__tests__/withdraw-states.test.tsx › Bank withdrawal keeps the $1 minimum for sub-$1 amounts
0.3s src/app/actions/__tests__/api-headers-extended.test.ts › should not include apiKey in validateInviteCode body
0.3s src/app/actions/__tests__/api-headers.test.ts › should include Content-Type in validateInviteCode
0.3s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › keeps stickers off the username pill (final pass respects the keep-out)
0.2s src/utils/__tests__/url.utils.test.ts › uses the public BASE_URL in Capacitor, not the localhost WebView origin
0.2s src/utils/__tests__/demo-balance.test.ts › starts at the full balance on a fresh install and stamps a timestamp
0.2s src/utils/__tests__/demo-balance.test.ts › auto-refills a wallet older than the TTL on cold start
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

@Hugo0
Hugo0 merged commit f6183f8 into main Aug 5, 2026
24 of 26 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