fix(notifications): stop email dispatch from logging one error per notification - #841
Merged
Merged
Conversation
…tification isEmailConfigured() exists specifically so callers can short-circuit before attempting a send — this dispatcher wasn't using it. Every dispatched notification for an email-enabled type went straight to getEmailClient(), which throws 'RESEND_API_KEY is not set', caught and logged as a fresh error every time. Found via a fleet-wide log audit: 56 identical errors in 24h, one per queued notification. The condition (no key deployed) is static, not per-notification — it only needs saying once. Now warns once per process via the same "warn once" pattern getEmailClient() already uses for its own placeholder-key case, then returns cleanly. This does not configure email — RESEND_API_KEY is still absent from production, which is a config/product decision (provide a key, or decide notifications don't need email) for someone with the account, not something to fix by adding a credential blind. This fixes the failure MODE: loud once, not flooding forever. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9rKLxddothnXEtY6KDziN
2 tasks
catomean
added a commit
that referenced
this pull request
Aug 29, 2026
…tage (#844) Peer review on the log-flood fix (PR #841) flagged that "email notifications are disabled" reads as a benign default, not the outage it is — a quiet single warning is easy to miss, and this removes the only signal that notifications are being dropped. Reworded to say plainly that emails are being discarded and name the provider, so one grep hit is enough to act on. Co-authored-by: Georgy Butaev <41178744+g-but@users.noreply.github.com>
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.
Summary
RESEND_API_KEYis unset in production, which is a known/pending config gap — not something this PR fixes.sendEmailNotification(), and the dispatcher logged a freshlogger.errorper occurrence: 56 identical "RESEND_API_KEY is not set" errors in 24h, drowning any real email failure in the same log.isEmailConfigured()available but wasn't calling it before attempting a send. Added the guard: warns once per process instead of once per notification, then returns early.This does not configure email — sending real notification emails still needs a
RESEND_API_KEYon the box, which is a separate decision for the account owner.Test plan
tsc --noEmitclean🤖 Generated with Claude Code
https://claude.ai/code/session_01Y9rKLxddothnXEtY6KDziN