fix(cursor): imports from db/ modules, not the localDb barrel

Both files violated Hard Rule #2 (never barrel-import from localDb.ts) — a genuine lint error that had gone uncaught locally. refresh-cursor/route.ts imported getCachedProviderConnectionById from @/lib/localDb instead of its owning module, @/lib/db/readCache. tokenHealthCheckCursor.ts copied the same pattern from its sibling tokenHealthCheckCopilot.ts (an existing, already-suppressed violation) for updateProviderConnection; imports it from @/lib/db/providers instead, with no circular-import fallout (verified via the existing token-health-check-cursor and refresh-cursor-route test suites).
This commit is contained in:
Will Gordon
2026-08-01 22:12:41 -04:00
committed by diegosouzapw
parent 1914c0fdc4
commit fc51f84abb
2 changed files with 5 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
import { NextResponse } from "next/server";
import { getCachedProviderConnectionById } from "@/lib/localDb";
import { getCachedProviderConnectionById } from "@/lib/db/readCache";
import { updateProviderConnection } from "@/lib/db/providers";
import { sanitizeErrorMessage } from "@omniroute/open-sse/utils/error";
import { tryIdeAuth } from "@/lib/cursor/tokenExtractor";

View File

@@ -6,11 +6,12 @@
*
* Sibling to tokenHealthCheckCopilot.ts (same injection-to-avoid-circular-
* import technique — tokenHealthCheck.ts-private helpers passed as params
* rather than imported, and updateProviderConnection imported directly from
* @/lib/localDb) but greenfield: type-checked normally, no @ts-nocheck.
* rather than imported) but greenfield: type-checked normally, no
* @ts-nocheck, and imports updateProviderConnection directly from its
* owning module rather than the localDb barrel (Hard Rule #2).
*/
import { updateProviderConnection } from "@/lib/localDb";
import { updateProviderConnection } from "@/lib/db/providers";
import {
renewCursorConnection,
buildCursorRenewedUpdate,