From 51733b8d858bb7a2636e954e1ac415f6fc2623bd Mon Sep 17 00:00:00 2001 From: Salar <126340046+salarkhannn@users.noreply.github.com> Date: Sat, 13 Jun 2026 21:18:51 +0500 Subject: [PATCH] fix(db): correct misleading error message when DATABASE_REPLICA_URL is malformed (#5023) * v0.6.29: login improvements, posthog telemetry (#4026) * feat(posthog): Add tracking on mothership abort (#4023) Co-authored-by: Theodore Li * fix(login): fix captcha headers for manual login (#4025) * fix(signup): fix turnstile key loading * fix(login): fix captcha header passing * Catch user already exists, remove login form captcha * fix(db): correct misleading error message when DATABASE_REPLICA_URL is malformed The error message said reads fall back to the primary when unset, but the code throws a fatal error instead. The misleading parenthetical contradicted actual behavior and could waste time during incident response when an operator sees this message and expects graceful degradation. --------- Co-authored-by: Waleed Co-authored-by: Theodore Li Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti Co-authored-by: Theodore Li --- packages/db/db.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/db/db.ts b/packages/db/db.ts index dae0815ed1..28edc09818 100644 --- a/packages/db/db.ts +++ b/packages/db/db.ts @@ -31,7 +31,7 @@ export const db = drizzle(postgresClient, { schema }) const replicaUrl = process.env.DATABASE_REPLICA_URL if (replicaUrl && !/^postgres(ql)?:\/\//.test(replicaUrl)) { throw new Error( - 'DATABASE_REPLICA_URL is set but is not a postgres:// DSN — fix or unset it (reads fall back to the primary when unset)' + 'DATABASE_REPLICA_URL is set but is not a postgres:// DSN — fix the URL or unset the variable' ) }