Skip to content

doctor/preflight: validate adapter.setup works, not just baseURL reachability #19

@jbrecht

Description

@jbrecht

Problem

doctor (and the render preflight) checks that adapter.baseURL is reachable, but not that the target app is in a state where adapter.setup will actually succeed. "Reachable" is necessary but not sufficient.

The worst detour in the 0.9.0 dogfooding session was a dev server pointed at the wrong database (the app's default .env.local project instead of the dedicated test project the adapter seeds into). doctor happily reported ✓ app reachable (HTTP 307) while every tutorial would have failed at sign-in, because the steward the adapter seeded into DB-A didn't exist in DB-B that the server was reading.

Why it matters

This is a high-frequency foot-gun for any adapter that seeds into a DB the app must also read from (the entire "seed + sign in" pattern). A green doctor that precedes a guaranteed setup failure trains people to distrust doctor.

Suggested direction

Add a preflight that actually exercises (or dry-runs) adapter.setup and reports its failure clearly — or, more cheaply, surface a signal the adapter can expose about which environment/DB the target is using, so a mismatch is visible. Even just running adapter.setup once in doctor and reporting the exception would have turned a 20-minute detour into one line.

Follow-up to #12.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions