Repository navigation
Fix: email worker never received jobs; add roadmap - #14
Merged
Merged
Conversation
startEmailWorker() built its Worker without `prefix: QUEUE_PREFIX`, so BullMQ fell back to its default 'bull:' keys while the email queue writes under 'fakturly:'. The worker started cleanly and processed nothing: overdue notices and payment reminders were enqueued and never sent. The existing jobs test built its own worker with the right prefix, so it stayed green. The new regression test uses the production functions on both ends (getEmailQueue → startEmailWorker) and fails without the fix. The construction-only test worker now uses autorun: false, because a running worker on the same queue is a competing consumer that stole the regression test's job.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
startEmailWorker()created its BullMQ Worker withoutprefix: QUEUE_PREFIX.BullMQ then falls back to its default
bull:prefix, while the email queuewrites under
fakturly:. The worker started cleanly and watched keys nothingwrote to.
docs/roadmap.md, linked from the README: multi-tenancy first,then payments v2 (Bankgiro/BgMax), TOTP + BankID, refunds and recurring
invoices, API keys and webhooks, EU VAT + Peppol, Fortnox, and an AI layer.
Why the tests missed it
jobs.test.tsbuilt its own worker with the right prefix, so it tested a copyof the wiring rather than
startEmailWorker()itself.The new test
Adds a job through the real
getEmailQueue()and asserts the realstartEmailWorker()processes it. Verified both ways: fails with the prefixremoved, passes with it.
While writing it, a second issue showed up: the construction-only test worker
was still running and acted as a competing consumer, taking the job first.
It now uses
autorun: false.Verification
bun run typecheckclean; backend suite 481 pass / 9 skip / 0 failPOST /invoices/{id}/reminder→ the worker sends thereminder → an
EmailLogrow with a provider message id