Repository navigation
refactor(auth): email senders drop or send through one path - #584
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 46 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
The email, announcement and invitation senders each repeated the same checks: drop while email is disabled, drop once nothing is left to send, else compose and send. EmailSender::mail holds them, and DeliveryError::retryable builds a retryable failure without Retry-After.
90a2a4d to
5840617
Compare
Part of #544. Stacked on #579: its base is
refactor/544-operations-shutdown.The email, announcement and invitation senders each repeated the same three steps: drop the delivery while email is disabled, drop it once nothing is left to send, and otherwise compose and send.
EmailSender::mailnow holds them once. It takes the lookup as a future, so a disabled relay still reads nothing from the database.deliver,announceandinvitekeep their names and docs, since the tests call them, and each now callsmail.Five places also built
DeliveryError::Retryable { failure, retry_after: None }by hand.DeliveryError::retryable(failure)builds it now.{gone}text is formatted into the same string.deliveries/email/snapshotsare unchanged, and no.snap.newappeared.just db test: 495 of 497 pass. The two failures are thekeys::testsstatement timeouts that fail the same way onmain.Checks:
just fmt,cargo clippywith and without--all-features(-D warnings),cargo doc -D warnings,just db test.Note
Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)
🤖 Generated with Claude Code
Scope: auth-service deliveries and jobs (5 files, +73/−74).
Email delivery (deliveries/email/mod.rs, +23/−28 in file set):
mailmethod for account emails, announcements, and invitations.maildrops delivery without a lookup when email is disabled.maildrops delivery when content is absent, and logs the supplied reason.mailcomposes and sends the message.Retryable { retry_after: None }construction withDeliveryError::retryable.Error constructor (deliveries/mod.rs):
pub(crate) const fn retryable(failure: Failure) -> DeliveryError.Retryableconstruction in the send-timeout fallback.Shutdown handling (deliveries/mod.rs, jobs/mod.rs):
Shutdown::unless, which races work against shutdown with a biased select. It returnsNonewhen shutdown wins.tokio::select!waits in the worker claim, polling, backlog-tick, and backlog-query paths.Transport and signing (deliveries/outbound.rs, deliveries/backchannel.rs):
transport_errorusesretryablefor resolution, timeout, and connection failures. Forbidden resolutions stay permanent. Builder errors stay permanent.retryable(Failure::Signing).Not verified: test results and snapshot status were not checked against the current head.