Emails 0.1.17: Manual polls run even when background polling is off
Emails 0.1.17 makes a manual poll for delivery events actually run, and keeps the background polling chains to exactly one scheduled job each.
A manual SQS poll did nothing while SQS polling was switched off, the case it is most needed for, even though the log said it was running. It also moved the regular chain’s next run to now. Manual polls for SQS and for Brevo, including the Poll now button in the Brevo settings, now run one cycle whatever the background toggle says, without touching the regular schedule. The other checks still apply: the email system must be on and a send profile must use the provider.
Turning polling off no longer deletes queued jobs. The next job sees the switch is off and ends the chain itself.
Full release notes: Emails 0.1.17
0.1.17 · 26 July 2026
Changed
- Both polling chains (
SQSPollingJob,BrevoPollingJob) now guarantee “exactly one queued future job” with Oban’s own uniqueness instead of a manual delete-then-insert. The workers carryunique: [period: :infinity, states: [:scheduled]](:executingdeliberately excluded — Oban’s conflict check has no self-exclusion, so a self-rescheduling job would match its own row and stall the chain every cycle), and the managers’ immediate inserts use a per-callunique: [:available, :scheduled]+replace: [scheduled_at]override so enabling while a tick is already queued moves that job up rather than appending a second one.cancel_scheduled/0is gone from both jobs, anddisable_polling/0no longer deletes anything — the queued job’s ownshould_poll?/0check ends the chain on its next tick. (#21) BrevoPollingManager.poll_now/0now insertsargs: %{"forced" => true}, whichBrevoPollingJob.perform/1honours by running one cycle regardless of thebrevo_events_enabledtoggle (still subject toEmails.enabled?/0and the sender-aware gate). The distinct args also keep manual polls in their own uniqueness namespace, so they never move or cancel the regular chain’s next scheduled tick. (#21)
Fixed
SQSPollingManager.poll_now/0was a silent no-op whenever SQS polling was disabled — the one case an operator is most likely to use it. It inserted a job with the regular chain’s args, whichSQSPollingJob.perform/1then dropped on itsshould_poll?/0gate, even though the manager logged “Polling is disabled, but executing manual poll”. It now inserts a forced job (args: %{"forced" => true}) that bypasses thesqs_polling_enabledtoggle for that single cycle, mirroring Brevo;Emails.enabled?/0, the SES-events switch, and the sender-aware profile gate are still enforced, andschedule_next_poll/1still refuses to resurrect the chain. (#21)SQSPollingManager.poll_now/0also reset the regular chain’s cadence: sharing the regular chain’s args made itsunique/replaceinsert conflict with the already-scheduled next tick and move that job’sscheduled_atto now. Manual polls are now independent of the chain. (#21)
Emails 0.1.17. Install or update: {:phoenix_kit_emails, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.