Skip to content

fix(verification): preserve working email verification flows - #3

Merged
matteius merged 2 commits into
mainfrom
fix/verification-task-lifecycle
Oct 30, 2026
Merged

matteius merged 2 commits into
mainfrom
fix/verification-task-lifecycle

Conversation

@matteius

@matteius matteius commented Oct 30, 2026 •

Copy link
Copy Markdown

A delayed welcome-email task deleted pending verification records and replaced their codes. This could invalidate a code in a verification email the user had already received, or cause the queued verification task to fail because its record had disappeared.

Welcome delivery and its retries now preserve existing verification codes. Explicit resends still replace older requests. Completing verification through either the code form or email link consumes all outstanding verification codes for that user. Deleted or expired queued requests are skipped; actual database and email-provider errors still propagate for retry.

Validation: new flow tests reproduced failures with a welcome task running both before and after verification-email delivery. The corrected tests read codes/links from rendered emails, POST them through the HTTP verification endpoint, assert the user is verified, and assert outstanding codes are consumed. Coverage includes reordered resend tasks, delayed welcome delivery, expiry followed by resend, duplicate tasks after completion, and welcome delivery retries with either email's link. The full local SQLite suite passes (2,132 tests plus three subtests); targeted Ruff and mypy pass. CI also covers PostgreSQL and Python 3.12/3.14.

Fixes OPENSENSOR-FIEF-1

Treat deleted and expired verification requests as completed no-ops. Preserve database and delivery failures for retries, with regression coverage for each case.

Fixes OPENSENSOR-FIEF-1
Preserve outstanding verification requests when welcome delivery runs or retries. Consume all pending codes on successful verification. Add HTTP flow tests using codes from rendered emails for resend ordering, delayed welcome, expiry, and delivery retries.
@matteius matteius changed the title fix(tasks): skip obsolete verification emails fix(verification): preserve working email verification flows Oct 30, 2026
@matteius
matteius merged commit 6426fa7 into main Oct 30, 2026
4 checks passed
@matteius
matteius deleted the fix/verification-task-lifecycle branch October 30, 2026 19:27
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