fix: gate console.log calls behind development check

Wraps unguarded console.log statements in use-connectors-electric,
mcp-config-validator, and ElectricProvider behind an IS_DEV guard,
matching the existing pattern in lib/electric/client.ts. Keeps
console.error calls untouched so real errors still surface.

Fixes #904
This commit is contained in:
Matt Van Horn 2026-03-23 23:29:16 -07:00
parent 5da2d95d80
commit b240057c61
No known key found for this signature in database
3 changed files with 14 additions and 8 deletions

View file

@ -5,6 +5,8 @@ import type { SearchSourceConnector } from "@/contracts/types/connector.types";
import type { SyncHandle } from "@/lib/electric/client";
import { useElectricClient } from "@/lib/electric/context";
const IS_DEV = process.env.NODE_ENV === "development";
/**
* Hook for managing connectors with Electric SQL real-time sync
*
@ -72,7 +74,7 @@ export function useConnectorsElectric(searchSpaceId: number | string | null) {
async function startSync() {
try {
console.log("[useConnectorsElectric] Starting sync for search space:", searchSpaceId);
if (IS_DEV) console.log("[useConnectorsElectric] Starting sync for search space:", searchSpaceId);
const handle = await electricClient.syncShape({
table: "search_source_connectors",
@ -80,7 +82,7 @@ export function useConnectorsElectric(searchSpaceId: number | string | null) {
primaryKey: ["id"],
});
console.log("[useConnectorsElectric] Sync started:", {
if (IS_DEV) console.log("[useConnectorsElectric] Sync started:", {
isUpToDate: handle.isUpToDate,
});