refactor: universal logger and remove N+1 catalog queries

- 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:
openhands
2026-10-17 14:29:14 +02:00
parent 6895eaab49
commit 59a45d2165
27 changed files with 416 additions and 241 deletions
+6 -1
View File
@@ -1,6 +1,7 @@
"use client";
import { useCallback, useEffect, useRef, useState } from "react";
import { logger } from "@/lib/logger";
import { useEventSource } from "@/lib/use-event-source";
/**
@@ -170,7 +171,11 @@ export default function RadioPlayer() {
.then((data) => {
if (data !== null) setConfig(parseConfig(data));
})
.catch((error) => console.error("[Radio] Config fetch failed:", error));
.catch((error) =>
logger.error("[Radio] Config fetch failed", {
err: error as Error,
}),
);
}, []);
// Keep the <audio> volume in sync with the slider.