fix(api): graceful 503 on email send when Redis/MTA unavailable #4055
ccantynzcommented Jun 15, 2026
Originally written by @vercel[bot] on GitHub.
Deployment failed with the following error:
There is no GitHub account connected to this Vercel account.ccantynzcommented Jun 15, 2026
Originally written by @vercel[bot] on GitHub.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Actions | Updated (UTC) |
|---|---|---|---|
| alec-rae-com-admin | Jun 15, 2026 11:45pm |
Cross-repo impact
See what breaks downstream if this PR merges.
⮌ Merged
This pull request was merged into main.
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts
Originally written by @ccantynz-alt on GitHub.
Imported from https://github.com/ccantynz-alt/AlecRae.com/pull/76
Summary
POST /v1/messages/send: Previously crashed with a raw 500 if Redis was down or the MTA worker wasn't running. Now returns HTTP 503 with"Email saved but delivery queue unavailable. The MTA worker may not be running. Check REDIS_URL and alecrae-mta service."— email is still saved to DB, user gets a clear diagnosticContext
The MTA worker (
services/mta) runs as a separate process consuming BullMQ jobs from Redis. Until Redis andalecrae-mtaare set up on the box, every compose+send would crash with a 500. This makes the failure graceful and diagnosable.Test plan
POST /v1/messages/sendreturns 503 with the diagnostic message (not 500)POST /v1/messages/sendreturns 202 as beforehttps://claude.ai/code/session_017mhAkS4qhMjcvVnyFi61xp
Generated by Claude Code