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 9589cc2
Browse filesBrowse the repository at this point in the historyBrowse files
Findings from the multi-model consensus review of #1122. Each was reproduced
before being fixed.
**Installing a driver deleted the previous one.** `installOptionalDriver` ran
`npm install --no-save`, so npm treated every already-installed driver as
extraneous and pruned it. Reproduced on npm 11.12.1: installing `mysql2` into a
prefix holding `pg` printed `added 12 packages, and removed 14 packages`. A user
adding a second warehouse silently lost the first — re-creating the exact defect
this module exists to fix. The install now saves to the directory's manifest,
which makes it genuinely additive (verified across three drivers).
**A half-installed package reported as installed.** `resolveOptionalPackage`
fell back to returning the package directory when `require.resolve` failed, so
an empty `node_modules/pg` resolved successfully and `isDriverInstalled` was
true. `warehouse_install_driver` then answered "already installed, no action
taken" and the driver could never be repaired. Resolution now requires a
manifest and an entry file that exists, and keeps searching later roots instead
of returning a path the caller cannot import.
**Azure AD auth used the pattern this PR removes.** `sqlserver.ts` still called
`import("@azure/identity" as string)`, which cannot resolve inside the compiled
binary, so an installed `@azure/identity` was invisible and every Azure AD login
silently fell through to the az CLI. Routed through a new `loadOptionalPackage`
(soft variant that returns undefined rather than throwing, since this caller has
a real fallback), and declared as a non-driver external.
**Six warehouse types never got a readiness note.** `DRIVER_MAP` routes 18 type
strings onto 13 drivers, but `driverForWarehouseType` matched only the 12
canonical names, so a connection added as `postgresql`, `mariadb`, `mssql`,
`fabric` or `mongo` skipped the check added for #61 — the silent-broken-
connection case that issue is about.
**Test quality.** The review mutation-tested `isModuleNotFound` by deleting it
and all 22 tests still passed; its fixture was never ambiently resolvable, so
the branch was unreachable. Applying the same technique to the new fixes showed
the first half-installed test was also vacuous. `isModuleNotFound` and
`npmInstallArgs` are now exported and pinned directly, and four mutants — always-
missing predicate, `--no-save` restored, manifest check removed, bare-directory
return — each fail at least one test.
Tests: 172 drivers unit (was 162), 4,712 opencode, 140 Docker-backed driver e2e.
Typecheck clean.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
0 commit comments