Skip to content

fix(api): reject deleted referral codes - #103

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-management-a498
Draft

fix(api): reject deleted referral codes#103
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-management-a498

Conversation

@cursor

@cursor cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Expire pending shareable referral codes inside DELETE /v1/agent before the account is anonymized.
  • Reject expired referral codes and legacy codes whose referrer has already been anonymized.
  • Add regression coverage for deleted-referrer and expired-code redemption, and wire the referral test into npm test.

Bug and impact

A deleted account's shareable Referral row stayed pending after account deletion. Because signup identity is intentionally erased, the same person could recreate the account, verify email, and apply the old deleted account's referral code to mint 500 credits repeatedly.

Validation

  • npm run build
  • node tests/critical-regressions.test.mjs
  • node tests/referral-reward.test.mjs
  • TEST_BASE_URL=https://archtools.dev npm test
Open in Web View Automation 

cursoragent and others added 2 commits July 29, 2026 05:06
Co-authored-by: Deesmo <Deesmo@users.noreply.github.com>
Co-authored-by: Deesmo <Deesmo@users.noreply.github.com>
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.

1 participant