refactor: universal logger and remove N+1 catalog queries
CI / check (push) Successful in 28s
CI / tests-ui (push) Failing after 32s
CI / tests-unit (push) Successful in 1m43s
CI / tests-quality (push) Successful in 1m14s
CI / tests-integration (push) Successful in 1m50s
CI / preflight (push) Skipped
CI / deploy (push) Skipped
CI / tests-imaging-browsers (push) Successful in 1m56s
CI / check (push) Successful in 28s
CI / tests-ui (push) Failing after 32s
CI / tests-unit (push) Successful in 1m43s
CI / tests-quality (push) Successful in 1m14s
CI / tests-integration (push) Successful in 1m50s
CI / preflight (push) Skipped
CI / deploy (push) Skipped
CI / tests-imaging-browsers (push) Successful in 1m56s
- Replace all 39 console.* calls with universal logger (pino server, console browser) - Set server-only marker on import-badge.ts - Disable DB query logging in production - Add bulkInsertCatalogItems: one transaction instead of N per-item inserts - Add reserveCatalogItemIds helper for bulk ID allocation - Optimize translateCatalogItems: single inArray batch query instead of N per-item selects - Test mock updated for logger.debug - biome clean, tsc clean, 3569 tests passing
This commit is contained in:
1 parent
6895eaab49
commit
59a45d2165
27 files changed
+416
-241
No files matched your search
@@ -58,6 +58,7 @@ import {
|
||||
isValidCatalogLayout,
|
||||
LAYOUT_DESCRIPTIONS,
|
||||
} from "@/lib/catalog-layouts";
|
||||
import { logger } from "@/lib/logger";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const MAX_ITEMS_PER_RUN = 500;
|
||||
@@ -245,7 +246,9 @@ export function OrganizeImportsDialog({
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("[OrganizeImports] load failed:", error);
|
||||
logger.error("[OrganizeImports] load failed", {
|
||||
err: error as Error,
|
||||
});
|
||||
setLoadError(true);
|
||||
setGroups([]);
|
||||
} finally {
|
||||
@@ -358,7 +361,9 @@ export function OrganizeImportsDialog({
|
||||
);
|
||||
})
|
||||
.catch((error) =>
|
||||
console.error("[OrganizeImports] page search failed:", error),
|
||||
logger.error("[OrganizeImports] page search failed", {
|
||||
err: error as Error,
|
||||
}),
|
||||
)
|
||||
.finally(() => setDestSearchLoading(false));
|
||||
return () => ac.abort();
|
||||
@@ -761,7 +766,9 @@ export function OrganizeImportsDialog({
|
||||
}
|
||||
onOpenChange(false);
|
||||
} catch (error) {
|
||||
console.error("[OrganizeImports] create failed:", error);
|
||||
logger.error("[OrganizeImports] create failed", {
|
||||
err: error as Error,
|
||||
});
|
||||
toast.error(t("errorFailed"));
|
||||
} finally {
|
||||
setIsCreating(false);
|
||||
|
||||
Reference in new issue
Block a user