Skip to content

fix(email-otp): match upstream replacement ordering - #133

Draft
salasebas wants to merge 1 commit into
mainfrom
salasebas/parity-redis-15-email-otp-replace
Draft

fix(email-otp): match upstream replacement ordering#133
salasebas wants to merge 1 commit into
mainfrom
salasebas/parity-redis-15-email-otp-replace

Conversation

@salasebas

Copy link
Copy Markdown
Owner

Summary

  • match Better Auth v1.6.23 Email OTP replacement ordering
  • keep the existing verification observable while the initial replacement create is pending
  • delete by identifier and retry exactly once only after a raised create error, with a refreshed expiry
  • cover database-only, secondary-only, and secondary-plus-database verification storage modes

Upstream parity

Pinned reference: Better Auth v1.6.23 at 9dfceee14021fc15a2fb93023f39635f25b0b5ba, packages/better-auth/src/plugins/email-otp/routes.ts.

Root cause: Ruby unconditionally deleted the existing verification before creating its replacement. Upstream creates first and enters delete-plus-retry only when that create rejects.

Checks

  • focused replacement matrix: 4 runs, 43 assertions, 0 failures, 0 errors
  • full core suite: 1,546 runs, 9,460 assertions, 0 failures, 0 errors
  • repository-wide StandardRB
  • fresh blind diff-only parity review: Approve

Create replacement verifications before deleting existing values, and only delete then retry after a failed create. Cover database, secondary, and dual storage replacement behavior.
@vercel

vercel Bot commented Aug 20, 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)
better-auth Ignored Ignored Aug 20, 2026 9:52pm

@github-actions github-actions Bot added the core label Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant