You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add Sentry observability for rate-limit cache failures and missing RESEND_API_KEY #478
Two findings from the #474 release review (silent-failure-hunter):
Rate-limit cache failures
backend/src/middleware/rateLimit.ts:208-213 — when the Cloudflare Cache API throws (cold starts, regional issues), the fail-open path only calls console.error. Workers logs are not aggregated into our Sentry/dashboard. Sustained cache failures would be invisible — rate limiting silently disabled.
Missing RESEND_API_KEY
backend/src/routes/admin.ts — sendBroadcast() is called at 6 sites with c.env.RESEND_API_KEY passed unchecked. When the secret is missing, the function returns a 200 OK with all recipients recorded as failures. Admins get no signal that the key is misconfigured.
Proposal
Add a logError(err, { context }) helper that posts to Sentry AND console.error in one call.
Wire it into the rate-limit catch block with { context: 'rate-limit-cache' }.
Add a precondition check at each sendBroadcast site (or inside the function): if RESEND_API_KEY is empty/missing, return a structured error to the admin (500 with { error: 'email_service_unconfigured' }) instead of pretending the send succeeded.
Activity
neuromechanist commentedon May 14, 2026
Merged via PR #483.
Address PR #504 review findings
Phase 2: metadata.json sibling endpoint for indexing (#504)