Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-23 21:24:30 +00:00
co-authored by renee-png
parent 04eced26a1
commit babb57c428
+6 -1
View File
@@ -2,6 +2,11 @@ import { sendLovableEmail } from '@lovable.dev/email-js'
import { createClient } from '@supabase/supabase-js'
import { createFileRoute } from '@tanstack/react-router'
// The email infra tables (email_send_log, email_send_state, etc.) are not in
// the generated Database types, so we use an untyped client throughout this
// route. Tables are created by the email infra migration.
type AnyClient = ReturnType<typeof createClient<any, any, any>>
const MAX_RETRIES = 5
const DEFAULT_BATCH_SIZE = 10
const DEFAULT_SEND_DELAY_MS = 200
@@ -37,7 +42,7 @@ function getRetryAfterSeconds(error: unknown): number {
// Move a message to the dead letter queue and log the reason.
async function moveToDlq(
supabase: ReturnType<typeof createClient>,
supabase: AnyClient,
queue: string,
msg: { msg_id: number; message: Record<string, unknown> },
reason: string