fix(db): correct misleading error message when DATABASE_REPLICA_URL is malformed#5023
Conversation
…ership workflow edits via sockets, ui improvements
…ng improvements, posthog, secrets mutations
…ration, signup method feature flags, SSO improvements
* feat(posthog): Add tracking on mothership abort (simstudioai#4023) Co-authored-by: Theodore Li <theo@sim.ai> * fix(login): fix captcha headers for manual login (simstudioai#4025) * fix(signup): fix turnstile key loading * fix(login): fix captcha header passing * Catch user already exists, remove login form captcha
…nts, secrets performance, polling refactors, drag resources in mothership
…y invalidation, HITL docs
…endar triggers, docs updates, integrations/models pages improvements
…ions, jira forms endpoints
…mat, logs performance improvements fix(csp): add missing analytics domains, remove unsafe-eval, fix workspace CSP gap (simstudioai#4179) fix(landing): return 404 for invalid dynamic route slugs (simstudioai#4182) improvement(seo): optimize sitemaps, robots.txt, and core web vitals across sim and docs (simstudioai#4170) fix(gemini): support structured output with tools on Gemini 3 models (simstudioai#4184) feat(brightdata): add Bright Data integration with 8 tools (simstudioai#4183) fix(mothership): fix superagent credentials (simstudioai#4185) fix(logs): close sidebar when selected log disappears from filtered list; cleanup (simstudioai#4186)
v0.6.46: mothership streaming fixes, brightdata integration
…m integration, atlassian triggers
…oogle slides endpoints, DB access pattern improvements
…er, search & replace UX, kb connectors multi-select, mcp negative cache
…fal-ai hosted key
… support, executor code cleanup
…ter, hosted-key queueing v0.6.92: enrichment table column type, table run fixes, scheduled jitter, hosted-key queueing
… messages table, user stats hot path improvements, RB2B
v0.6.95: data enrichment block, nullable workflow description fix
…ables UI improvements, new slack scopes, model-level denylists, object storage tracespans
…ble, integration icons audit
…ion, together AI, Baseten, Ollama Cloud, Linq integrations, kb doc ownership bindings
…dgebase connector, SSO provider ID allowlist, singleton memory leak fix
…rs, clickhouse integration
…ration, smooth streaming, security hardening, db fixes
…x, db migrations from ci, docs updates, read replicas v0.7.3: jira oauth scope fix, read-replica client, table wire data fix, db migrations from ci, docs updates, read replicas
…uting, trigger.dev, temporal, latex, quartr, brex, convex integrations
…rovements, styling consolidation
…s 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.
|
@salarkhannn is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
PR SummaryLow Risk Overview The message no longer implies that reads fall back to the primary when the variable is unset—that fallback only applies when the env var is absent. When it is set to a bad value, startup still fails; the text now tells operators to fix the URL or unset the variable instead of pointing at unset behavior. Reviewed by Cursor Bugbot for commit 4027930. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR corrects a misleading error message in
Confidence Score: 5/5The change touches only a string literal inside an error-throw branch that is already exercised solely when startup validation fails. No runtime logic, schema, or data path is altered. The edit replaces one error message string with a more accurate one. The validation condition, the throw, and every code path around it are left untouched. The corrected wording removes a clause that contradicted actual behavior, making the message a faithful description of what operators must do to recover. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Module loads] --> B{DATABASE_REPLICA_URL set?}
B -- No / undefined --> C[dbReplica = db primary\nsilent fallback]
B -- Yes --> D{Matches postgres:// DSN?}
D -- No --> E[throw Error\n'fix the URL or unset the variable'\nno fallback]
D -- Yes --> F[dbReplica = drizzle replica client]
Reviews (1): Last reviewed commit: "fix(db): correct misleading error messag..." | Re-trigger Greptile |
The error message claimed reads fall back to the primary when DATABASE_REPLICA_URL is unset, but this only applies when the variable is absent entirely. When the variable is set to an invalid value, the code throws a fatal error — there is no graceful fallback. The misleading parenthetical contradicted the actual behavior and could misdirect operators debugging a configuration issue during an incident.