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:
11
.changeset/remove-dead-dashboard-perf-log.md
Normal file
11
.changeset/remove-dead-dashboard-perf-log.md
Normal 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.
|
||||
@@ -61,7 +61,7 @@ import { NativeShellOnboardingModal } from "./components/NativeShellOnboardingMo
|
||||
import { NativeShellConnectionManager } from "./components/NativeShellConnectionManager";
|
||||
import { NativeShellConnectionStatus } from "./components/NativeShellConnectionStatus";
|
||||
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 { subscribeSse } from "./sse-bus";
|
||||
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`;
|
||||
if (!IS_TEST_ENV) {
|
||||
console.log(`[App] ${msg}`);
|
||||
reportDashboardPerf("[App]", msg);
|
||||
}
|
||||
}
|
||||
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`;
|
||||
if (!IS_TEST_ENV) {
|
||||
console.log(`[App] ${msg}`);
|
||||
reportDashboardPerf("[App]", msg);
|
||||
}
|
||||
}
|
||||
}, [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)`;
|
||||
if (!IS_TEST_ENV) {
|
||||
console.log(`[App] ${msg}`);
|
||||
reportDashboardPerf("[App]", msg);
|
||||
}
|
||||
setInitialLoadComplete(true);
|
||||
}, DASHBOARD_READY_SETTLE_DELAY_MS);
|
||||
|
||||
@@ -5551,19 +5551,6 @@ export function fetchProjectsAcrossNodes(): Promise<ProjectInfoWithSource[]> {
|
||||
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 */
|
||||
export function fetchNodes(): Promise<NodeInfo[]> {
|
||||
return api<NodeInfo[]>("/nodes");
|
||||
|
||||
@@ -3,7 +3,6 @@ import type { ProjectInfo } from "../api";
|
||||
import {
|
||||
fetchProjectsAcrossNodes,
|
||||
registerProject,
|
||||
reportDashboardPerf,
|
||||
unregisterProject,
|
||||
updateProject,
|
||||
type ProjectCreateInput,
|
||||
@@ -64,18 +63,14 @@ export function useProjects(): UseProjectsResult {
|
||||
try {
|
||||
const data = await fetchProjectsAcrossNodes();
|
||||
const elapsed = Math.round(performance.now() - t0);
|
||||
const msg = `initial fetchProjectsAcrossNodes took ${elapsed}ms (${data.length} projects)`;
|
||||
console.log(`[useProjects] ${msg}`);
|
||||
reportDashboardPerf("[useProjects]", msg);
|
||||
console.log(`[useProjects] initial fetchProjectsAcrossNodes took ${elapsed}ms (${data.length} projects)`);
|
||||
if (!cancelled) {
|
||||
setProjects(data);
|
||||
setError(null);
|
||||
}
|
||||
} catch (err) {
|
||||
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] ${msg}`);
|
||||
reportDashboardPerf("[useProjects]", msg);
|
||||
console.warn(`[useProjects] initial fetch failed after ${elapsed}ms: ${err instanceof Error ? err.message : String(err)}`);
|
||||
if (!cancelled) {
|
||||
setError(err instanceof Error ? err.message : "Failed to fetch projects");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user