chore(dashboard): drop dead reportDashboardPerf client and its log file

The /_perf/dashboard-load server route no longer exists, so every
reportDashboardPerf() call was a silently-swallowed 404. Remove the helper
in legacy.ts plus its five call sites in App.tsx / useProjects.ts (the
companion console.log lines stay), and drop the dashboard-perf.log entry
from the test-isolation runtime ignore list since nothing writes that file
anymore.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-06 12:14:26 -07:00
parent 593b42ea79
commit 9087239078
4 changed files with 14 additions and 24 deletions

View File

@@ -0,0 +1,11 @@
---
"@runfusion/fusion": patch
---
Remove the dead `reportDashboardPerf` client and its five call sites in
`App.tsx` / `useProjects.ts`. The companion server route `/_perf/dashboard-load`
no longer exists, so every call was a silently-swallowed 404. Also drops the
`dashboard-perf.log` runtime ignore-list entry from
`scripts/check-test-isolation.mjs` since nothing creates that file anymore.
Console-side perf logging via `console.log("[App] …")` and
`console.log("[useProjects] …")` is preserved.

View File

@@ -61,7 +61,7 @@ import { NativeShellOnboardingModal } from "./components/NativeShellOnboardingMo
import { NativeShellConnectionManager } from "./components/NativeShellConnectionManager"; import { NativeShellConnectionManager } from "./components/NativeShellConnectionManager";
import { NativeShellConnectionStatus } from "./components/NativeShellConnectionStatus"; import { NativeShellConnectionStatus } from "./components/NativeShellConnectionStatus";
import type { AiSessionSummary } from "./api"; import type { AiSessionSummary } from "./api";
import { fetchUnreadCount, reportDashboardPerf, fetchTaskDetail, fetchWorkflowSteps } from "./api"; import { fetchUnreadCount, fetchTaskDetail, fetchWorkflowSteps } from "./api";
import { getScopedItem, setScopedItem } from "./utils/projectStorage"; import { getScopedItem, setScopedItem } from "./utils/projectStorage";
import { subscribeSse } from "./sse-bus"; import { subscribeSse } from "./sse-bus";
import { AUTH_TOKEN_RECOVERY_REQUIRED_EVENT } from "./auth"; import { AUTH_TOKEN_RECOVERY_REQUIRED_EVENT } from "./auth";
@@ -296,7 +296,6 @@ function AppInner() {
const msg = `projects loaded at ${Math.round(performance.now() - mountTimeRef.current)}ms from mount`; const msg = `projects loaded at ${Math.round(performance.now() - mountTimeRef.current)}ms from mount`;
if (!IS_TEST_ENV) { if (!IS_TEST_ENV) {
console.log(`[App] ${msg}`); console.log(`[App] ${msg}`);
reportDashboardPerf("[App]", msg);
} }
} }
if (!currentProjectLoading && !projectReadyLoggedRef.current) { if (!currentProjectLoading && !projectReadyLoggedRef.current) {
@@ -304,7 +303,6 @@ function AppInner() {
const msg = `current-project resolved at ${Math.round(performance.now() - mountTimeRef.current)}ms from mount`; const msg = `current-project resolved at ${Math.round(performance.now() - mountTimeRef.current)}ms from mount`;
if (!IS_TEST_ENV) { if (!IS_TEST_ENV) {
console.log(`[App] ${msg}`); console.log(`[App] ${msg}`);
reportDashboardPerf("[App]", msg);
} }
} }
}, [projectsLoading, currentProjectLoading]); }, [projectsLoading, currentProjectLoading]);
@@ -323,7 +321,6 @@ function AppInner() {
const msg = `dashboard ready at ${Math.round(performance.now() - mountTimeRef.current)}ms from mount (settle delay=${Math.round(performance.now() - settleStart)}ms)`; const msg = `dashboard ready at ${Math.round(performance.now() - mountTimeRef.current)}ms from mount (settle delay=${Math.round(performance.now() - settleStart)}ms)`;
if (!IS_TEST_ENV) { if (!IS_TEST_ENV) {
console.log(`[App] ${msg}`); console.log(`[App] ${msg}`);
reportDashboardPerf("[App]", msg);
} }
setInitialLoadComplete(true); setInitialLoadComplete(true);
}, DASHBOARD_READY_SETTLE_DELAY_MS); }, DASHBOARD_READY_SETTLE_DELAY_MS);

View File

@@ -5551,19 +5551,6 @@ export function fetchProjectsAcrossNodes(): Promise<ProjectInfoWithSource[]> {
return api<ProjectInfoWithSource[]>("/projects/across-nodes"); return api<ProjectInfoWithSource[]>("/projects/across-nodes");
} }
/**
* Append a client-side perf measurement to the shared dashboard-perf log on disk.
* Used when browser devtools aren't available (e.g. mobile). Best-effort.
*/
export function reportDashboardPerf(source: string, message: string): void {
void api("/_perf/dashboard-load", {
method: "POST",
body: JSON.stringify({ source, message }),
}).catch(() => {
// best-effort only
});
}
/** Fetch all registered nodes */ /** Fetch all registered nodes */
export function fetchNodes(): Promise<NodeInfo[]> { export function fetchNodes(): Promise<NodeInfo[]> {
return api<NodeInfo[]>("/nodes"); return api<NodeInfo[]>("/nodes");

View File

@@ -3,7 +3,6 @@ import type { ProjectInfo } from "../api";
import { import {
fetchProjectsAcrossNodes, fetchProjectsAcrossNodes,
registerProject, registerProject,
reportDashboardPerf,
unregisterProject, unregisterProject,
updateProject, updateProject,
type ProjectCreateInput, type ProjectCreateInput,
@@ -64,18 +63,14 @@ export function useProjects(): UseProjectsResult {
try { try {
const data = await fetchProjectsAcrossNodes(); const data = await fetchProjectsAcrossNodes();
const elapsed = Math.round(performance.now() - t0); const elapsed = Math.round(performance.now() - t0);
const msg = `initial fetchProjectsAcrossNodes took ${elapsed}ms (${data.length} projects)`; console.log(`[useProjects] initial fetchProjectsAcrossNodes took ${elapsed}ms (${data.length} projects)`);
console.log(`[useProjects] ${msg}`);
reportDashboardPerf("[useProjects]", msg);
if (!cancelled) { if (!cancelled) {
setProjects(data); setProjects(data);
setError(null); setError(null);
} }
} catch (err) { } catch (err) {
const elapsed = Math.round(performance.now() - t0); const elapsed = Math.round(performance.now() - t0);
const msg = `initial fetch failed after ${elapsed}ms: ${err instanceof Error ? err.message : String(err)}`; console.warn(`[useProjects] initial fetch failed after ${elapsed}ms: ${err instanceof Error ? err.message : String(err)}`);
console.warn(`[useProjects] ${msg}`);
reportDashboardPerf("[useProjects]", msg);
if (!cancelled) { if (!cancelled) {
setError(err instanceof Error ? err.message : "Failed to fetch projects"); setError(err instanceof Error ? err.message : "Failed to fetch projects");
} }