CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

fix(emergency-pat): dual-driver like src/db — works on self-hosted Postgres #5518

Merged⚡ AI-generatedXSccantynz wants to mergefix/emergency-pat-selfhostmainopened 10d ago
ccantynzcommented 10d ago

Why Craig's on-box mint failed

scripts/emergency-pat.ts hardcoded the Neon HTTP driver — on the Vapron box's localhost Postgres it built https://localhost/sql and died with an inscrutable ConnectionRefused. The app's own db layer has had dual-driver auto-detection since 2026-08-19; the script predates it and was only ever run against production Neon.

  • Same isNeonUrl rule as src/db: *.neon.tech → neon-http, everything else → postgres.js TCP. Queries unchanged (both drivers are tagged templates returning row arrays).
  • The success output now names which instance the token belongs to (host from APP_BASE_URL) — the wrong-instance trap is the entire reason anyone reaches for this script.
  • postgres.js pool closed best-effort before exit.

Typecheck clean.

🤖 Generated with Claude Code

ccantynzAI Reviewcommented 10d ago

AI Triage

(no summary)

Priority: medium Risk area: mixed

Suggested labels: (no label suggestions) Suggested reviewers: (no reviewer suggestions)

Suggestions only — nothing has been applied. The PR author stays in control.

gluecron[bot]🤖 botAI Reviewcommented 10d ago

AI review unavailable

The platform's AI balance is exhausted, so AI generation is temporarily unavailable. Nothing was lost. You can queue this as a repair for the internal agent from the repository's Health page, or try again once the balance is restored. The PR is otherwise unchanged.

Cross-repo impact

See what breaks downstream if this PR merges.

Analyze →
⮌ Merged

This pull request was merged into main.

c comment · e edit title · m merge · a approve · r request changes · ? shortcuts