You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7f5ebb9
Browse filesBrowse the repository at this point in the historyBrowse files
fix(drivers): address #1238 review — directory/create ordering, file: URI slashes, Windows paths, telemetry mislabel, post-probe failure
Follow-up to #1238's own review round (8 threads, all on the new code that PR
added). Verified each against current code before acting; fixed the real bugs
with tests, replied with reasoning on the one genuine design call.
- file-store.ts: `create: true` bypassed the new directory check entirely,
since `if (allowCreate) return` ran before it — a directory path with
`create: true` reached the driver instead of getting this guard's clear
error. Extracted `rejectIfDirectory()` and moved it before the `allowCreate`
bypass in both the plain-path and `file:` URI branches, since neither engine
can create a database at a path that's already a directory.
- file-store.ts `absoluteFileUriPath`: the leading-slash check was bounded to
1-3 slashes, so `file:////mnt/share/warehouse.duckdb` (UNC-style, 4+
slashes) was treated as relative and bypassed the existence guard. Verified
`fileURLToPath` handles any number of leading slashes without throwing;
widened the check to `/^\/+/`.
- file-store.ts `isLocalFilePath`: the `scheme://` regex accepted a
single-character scheme, so a doubled-slash Windows path like
`C://data/warehouse.duckdb` matched it exactly like `s3://...` and was
misclassified as remote. No real scheme is a single letter; require 2+
characters before `://`.
- sql-execute.ts: the previous round's "fingerprint on every outcome" fix
mislabeled the catch block. `sql.execute` never throws for a
connection/query failure — it returns a result carrying `error`, already
fingerprinted on the result-error branch. The catch block only fires when
the query never reached a warehouse at all (e.g. dispatcher down), so
fingerprinting it there folded "never executed" into a signal meant to
measure "executed SQL", re-biasing the telemetry in the opposite direction.
Removed the catch-block emission; kept it on success + result-error only.
- drivers-e2e.test.ts: if DuckDB setup failed after the availability probe
already passed, every test's `if (!duckdbReady) return` guard reported a
pass instead of a failure — the same vacuous-green class as the false-skip
bug, one layer down. Extracted `connectWithRetry()`, which now throws (with
the underlying error) once retries are exhausted instead of swallowing it;
`beforeAll` no longer catches that throw, so a genuine post-probe failure
now fails the whole describe block. Added a standalone unit test for the
helper that runs independent of real DuckDB availability.
Not fixed — genuine design call, replied with reasoning, left open: a custom
DuckDB extension using an unlisted bare `scheme:` form (e.g. `acme:catalog`)
is no longer forwarded, because narrowing the bare-scheme exclusion to a
closed list (to fix the `data:warehouse.duckdb` false-positive from the prior
round) is in direct, unavoidable tension with forwarding arbitrary unknown
bare schemes — nothing in the syntax alone can tell them apart.
Gates: `bun test packages/drivers/` 323/323 pass, `bun test
packages/opencode/test/altimate/` 5009/5009 pass (653 skip, unrelated),
`bun turbo typecheck` 13/13, marker check `--base origin/main --strict`
clean, prettier clean on every newly-written/substantially-edited file.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VqnuBDGkh1ZT65Ti7e6DHZ
0 commit comments