Skip to content

fix: let the App Store review account finish account deletion - #56

Merged
KMKoushik merged 1 commit into
mainfrom
fix/review-account-deletion
Nov 16, 2026
Merged

KMKoushik merged 1 commit into
mainfrom
fix/review-account-deletion

Conversation

@KMKoushik

@KMKoushik KMKoushik commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

App Review signs in with the demo account (REVIEW_LOGIN_EMAIL / REVIEW_LOGIN_CODE) but can't finish account deletion, because the deletion code is emailed to an inbox they can't see.

For that one account, requesting a deletion code now stores REVIEW_LOGIN_CODE instead of a random code and sends no email, the same way sign-in does. The goodbye email is skipped too. Everything else stays the same: a code still has to be requested first, and the expiry, attempt limits and constant-time check all apply. Other accounts are unaffected.

Deleting the account clears its email, so the reviewer's next sign-in creates a fresh account.

Tests: added an integration test covering these cases. The review code is rejected for a normal account, and that account still needs its emailed code. The review code is rejected before a code is requested. The review account is deleted with the review code and no email is sent. The reviewer can sign in again afterwards as a new account.

Summary by CodeRabbit

  • Bug Fixes
    • Review accounts can use their configured sign-in code during account deletion without receiving a deletion-code email.
    • Account-deletion confirmation emails are no longer sent to review accounts; other accounts continue to receive generated codes by email.
    • After deleting an account, the review email can be used to sign in again.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

Review-account emails use a normalized configured address and fixed code in sign-in and account deletion. The deletion flow skips code and goodbye emails for review accounts. An integration test covers code checks, deletion, and signing in again.

Changes: Review-account deletion

Layer / File(s) Summary
Review-login code helpers
src/server/mobileAuth.ts
isReviewLoginEmail is exported and compares normalized email addresses when a review code is configured. reviewLoginCode returns the trimmed, uppercase code. sendEmailCode uses this helper for review logins.
Review-account deletion flow
src/server/api/services/accountDeletion.ts, src/tests/accountDeletion.integration.test.ts
Deletion uses the fixed code for review accounts and skips sending them code and goodbye emails. The integration test checks code verification, deletion, and sign-in after deletion.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Merge Risk: Minimal · up to ebf0a

The App Store review account can now finish account deletion without emails being sent, and other accounts behave as before. No remaining merge-blocking risk was found.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@KMKoushik
KMKoushik merged commit 488953f into main Nov 16, 2026
1 of 2 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.

1 participant