mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-14 11:12:17 +03:00
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:
committed by
diegosouzapw
parent
1914c0fdc4
commit
fc51f84abb
@@ -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";
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user