Repository navigation
Description
Why
Choosing sync or async should be visible at the operation call. A Mailer-wide default and several overlapping send methods make it too easy to hide whether a call blocks or returns pending work. In 10.0.0, require explicit selection and return the existing submission receipt from every single-email send; callers can ignore it.
This is a separate enhancement under #722, coordinated with the unfinished SMTP probe in #733. Completed Phase 2 issues stay closed.
API
mailer.sync().sendMail(email); // ignore the receipt when only completion matters
MailSubmissionReceipt receipt = mailer.sync().sendMail(email);
MailSend<MailSubmissionReceipt> send = mailer.async().sendMail(email);The nested Mailer.Sync and Mailer.Async views each expose sendMail, sendMailsInSimpleBatch, and testConnection. The probe operations will be added to these views separately in #733. Single sends return receipts; simple batches stay lazy, sequential, first-failure-stopping and completion-only. Per-email batch outcomes remain available through the observer.
Remove builder .async(), isAsync(), the backing mode field, all flat/default-driven/boolean-execution-mode Mailer operations, and the separate receipt-specific send family. No deprecated forwarding aliases. Keep scoped MailSender, configuration, rehearsal, validation, queue inspection, open-connection callbacks and lifecycle APIs unchanged. Existing integrations must recompile and migrate deliberately.
The cached views share the owning Mailer's lifecycle, executor and pool. Preserve preparation/admission threads, cancellation, deadlines, observer and cleanup ordering, receipt identity, and exception semantics. Resource properties and Spring support are unchanged: execution mode is a choice made by application code, not a configuration default.
CLI send/connect use the synchronous view; daemon request concurrency stays daemon-owned. Remove and clearly reject --mailer:async and its option help. CLI probing remains separate in #733.
Implementation and review
- Implement views and remove the old mode-selecting API and receipt-discarding wrapper.
- Migrate integrations, CLI, demos, tests, public API consumers and current 10.0.0 documentation.
- Verify positive/negative API compilation, shared resources, receipts/failures, queue/cancellation/observer/batch regressions, CLI and supported Java/Spring lanes.
- Review production diffs and retain the probe review bookmark.
Accepted on 13 September 2026 and committed and pushed independently of the probe. The migration covers the existing send, simple-batch and connection-test families, their consumers and current 10.0.0 documentation. The probe's types, entry points, implementation and documentation remain uncommitted under #733.
Follow the root API expansion and coding guides. Preserve historical docs, staged research and unrelated Journal work. Keep #733 open and do not mark Phase 3 complete. The send architecture infographic remains accurate because its implementation layers and resource ownership do not change.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
refactor(mailer): require explicit sync and async views (#734)
docs(mailer): explain explicit execution views (#734)
bbottema commentedon Sep 13, 2026
Implemented for 10.0.0. Choose execution mode at the call:
The builder async default and old flat/boolean send methods are removed. Simple batches remain streaming and completion-only. SMTP probing is tracked separately in #733.
docs(cli): explain help before removed options (#734)
docs(cli): preserve Unicode in existing examples (#734)
docs(cli): preserve literal argument values (#734, #488)
fix(cli): honor help before later removed options (#734)
docs(cli): preserve Unicode in existing examples (#734)
fix(cli): preserve literal values across argument parsing (#734, #488)
merge(cli): integrate published argument fixes (#734, #488)
chore(review): track disposable CLI review files (#734, #488)
merge(cli): integrate published argument fixes (#734, #488)
chore(review): make CLI scratch cleanup executable (#734, #488)
merge(review): integrate actionable CLI cleanup (#734, #488)
docs(release): consolidate unreleased feature work (#488, #693, #704, #…
bbottema commentedon Nov 1, 2026
Development addenda for unreleased 10.0.0
These follow-ups complete this feature's 10.0.0 implementation. Dates identify the original development records; before examples describe earlier development revisions.
2026-10-27: Honor CLI help before later removed execution options
A removed CLI option after a genuine help request can replace the requested help with a migration error.
This currently reports that
--mailer:asyncwas removed. The command should show help successfully and ignore later arguments, as it already does for ordinary malformed options after help. Keep the migration error when the removed option comes before help or is supplied alone:Apply the existing generated-model help cutoff before checking removed execution-mode options. Standard
--help,-hand registered option-specific help follow the same ordering rule. Literal values that happen to end in--help, end-of-options handling, one-shot and daemon routing, and argument-file expansion keep their existing meanings. Help must not execute builders, read message content or acquire a Mailer.The maintainer approved this correction under ADR 0018, continuing the help distinction established in #841. No option names or public Java APIs change.
Acceptance requires help to win over every later removed-option spelling while earlier or standalone removed options retain their migration diagnostic. Ordinary help/value behavior and request routing remain consistent.
Completed behavior — 2026-10-27
Delivered on the 10.0.0 development branches. Standard and registered option-specific help ignore later removed execution-mode options. An earlier or standalone removed option keeps its migration diagnostic.
The existing command model still distinguishes genuine help from literal values, and argument-file and local/daemon routing retain their contracts. Help does not execute builders, read message content or acquire a Mailer. No flags, escaping rules or metadata format changed.
Implementation: cf3e5441, with documentation alignment in 70d3cf26. Website guidance: ac0c156. Decision: ADR 0018. Version 10.0.0 remains unreleased.
2026-10-27: Keep retired CLI option spellings usable as literal message values
The CLI rejects a literal message value when it happens to match a removed execution option.
This reports that
--mailer:asyncwas removed instead of using--mailer:async=falseas the subject. The same text should remain usable in subjects, bodies and header values, just like other unregistered option-shaped values.Let Picocli determine which arguments are values and which are unmatched options. Apply the existing migration diagnostic only when a retired execution option is actually unmatched. Keep the error for standalone retired options and those before a genuine help request; help still ignores later arguments. Standard parser errors, repeated builder calls, one-shot execution and daemon execution retain their existing behavior. No new option, escaping syntax or Java API is needed.
The maintainer approved this correction under ADR 0018, continuing the literal-value contract in #841 and help ordering in #734.
Acceptance requires each retired spelling to pass unchanged when consumed as a subject, body or header value, while actual retired options keep their migration error and help ordering.
Completed behavior — 2026-10-27
The subject now stays
--mailer:async=false. The same retired spellings remain usable as body and header values when Picocli consumes them as values. Actual retired options keep their migration error and existing help ordering.Available on the 10.0.0 development branch in the CLI change and the usage guide, following ADR 0018.