Repository navigation
feat: built-in job for Mail.queue of dox_mailer - #11
Conversation
Mail.queue() of dox_mailer needs a job that sends the saved email. dox_queue now has it: SendQueuedMail, and SendEncryptedQueuedMail for encrypt: true. Queue.configure() gives it to Mail.useQueue(). The builder only finds jobs in the app lib folder, so a package job is not in jobs.g.dart. JobRegistry now also finds the built-in jobs, after the jobs of the app. dox_queue now depends on dox_mailer (light: http and crypto). So dox_mailer must be released first.
Bot reviewResult: no must-fix. Label: review-ok. (CI fails until the new dox_mailer is on pub.dev. That is expected.) Checked locally with a gitignored path override to the dox-mailer PR branch: What holds up:
Release reminders (not for this PR):
Nits (optional):
|
The changelog no longer has the release note for maintainers. It now says to deploy the worker with the web app, because an old worker can not read the new mail job. The README says it too. The job builder now refuses an app job name that starts with dox_queue:, so it can not clash with a built-in job. New test: a failing transport goes through the normal tries and failed jobs. The encrypt test now also checks that the subject and the body are hidden.
Fixer reply
|
Bot reviewResult: no must-fix. Label: review-ok. (CI fails until the new dox_mailer is on pub.dev. That is expected.) Checked on What holds up:
Nits (optional):
|
dox_queue now needs Mail.queue of dox_mailer. That code is on dox-mailer main, but not on pub.dev yet. So CI took dox_mailer from pub.dev and failed. ci/use-siblings.sh now clones dox-mailer too.
Fixer reply
|
Bot reviewResult: no must-fix. Label: review-ok. Checked on What holds up:
Release reminders (not for this PR):
Nits (optional):
|
Problem
Mail.queue()of dox_mailer (dartondox/dox-mailer PR dartondox/dox-mailer#9) needs a job that sends the saved email. The job builder only finds@Job()classes in the lib folder of the app, so a job from a package is never injobs.g.dart.Effect
Without this, queued emails can not be sent by the worker.
Fix
SendQueuedMailandSendEncryptedQueuedMail(withShouldBeEncrypted, forencrypt: true). The names start withdox_queue:, so they can not clash with app jobs.JobRegistryalso findsJobRegistry.builtIn, after the app jobs. Apps add nothing.Queue.configure()callsMail.useQueue(), soMail.queue()works in the web server and in tests.Dependency and CI
dox_queue now depends on dox_mailer (it only adds
httpandcrypto). The other way (dox_mailer on dox_queue) would add analyzer, dox_orm and ioredis to every mail app.MailQueueis released. That is expected.dox_mailerto the new version, and release dox_mailer before dox_queue. The release order in release.md (same step 5) must say this.Tests
test/queue_mail_test.dart(new): sync driver sends at once; for sqlite, postgres, mysql and redis: the worker sends the saved mail with all fields and the attachment bytes, with an empty app registry; the same mailer and the queue name are kept;later()waits;encrypt: truehides the address in the saved data. Ran locally with sqlite and Redis: all pass. Fulldart test: all pass.dart analyze --fatal-infosanddart format: clean.