Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/dashboard/app/api/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6214,7 +6214,7 @@ export interface AgentPromptSizePoint {
totalChars: number;
}

function withProjectId(path: string, projectId?: string): string {
export function withProjectId(path: string, projectId?: string): string {
if (!projectId) return path;
const separator = path.includes("?") ? "&" : "?";
return `${path}${separator}projectId=${encodeURIComponent(projectId)}`;
Expand Down
18 changes: 6 additions & 12 deletions packages/dashboard/app/components/ReliabilityView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useCallback, useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { AlertCircle, Loader2 } from "lucide-react";
import { api, withProjectId } from "../api/legacy";
import { LineChart, PieChart } from "./command-center/charts/recharts";
import type { LineChartSeries, PieChartDatum } from "./command-center/charts/recharts";
import "./ReliabilityView.css";
Expand Down Expand Up @@ -42,7 +43,7 @@ function formatDateTime(value: string | null | undefined): string {
return Number.isNaN(parsed.getTime()) ? value : parsed.toLocaleString();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Missing changeset for a user-visible bug fix

AGENTS.md requires a changeset file whenever a change affects the published @runfusion/fusion package. @fusion/dashboard is bundled into @runfusion/fusion, and this PR is a behavioral bug fix (FUX-037: multi-project dashboard analytics were blending data across projects). No .changeset/<name>.md file exists in this PR — only the placeholder README.md is present. Without a changeset, this fix will not appear in operator release notes and the pnpm check:changesets gate may flag the PR. A "@runfusion/fusion": patch changeset with category: fix is needed.

Context Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

}

export function ReliabilityView() {
export function ReliabilityView({ projectId }: { projectId?: string } = {}) {
const { t } = useTranslation("app");
const [data, setData] = useState<ReliabilityResponse | null>(null);
const [isLoading, setIsLoading] = useState(true);
Expand All @@ -55,28 +56,21 @@ export function ReliabilityView() {
setIsLoading(true);
setError(null);
try {
const response = await fetch("/api/health/reliability");
if (!response.ok) {
throw new Error(`Failed to load reliability metrics (${response.status})`);
}
const payload = (await response.json()) as ReliabilityResponse;
const payload = await api<ReliabilityResponse>(withProjectId("/health/reliability", projectId));
setData(payload);
} catch (loadError: unknown) {
setError(loadError instanceof Error ? loadError.message : t("reliability.failedToLoad", "Failed to load reliability metrics"));
} finally {
setIsLoading(false);
}
}, [t]);
}, [t, projectId]);

const resetStats = useCallback(async () => {
setResetError(null);
const response = await fetch("/api/health/reliability/reset", { method: "POST" });
if (!response.ok) {
throw new Error(`Failed to reset reliability metrics (${response.status})`);
}
await api<void>(withProjectId("/health/reliability/reset", projectId), { method: "POST" });
await load();
setShowResetConfirm(false);
}, [load]);
}, [load, projectId]);

useEffect(() => {
void load();
Expand Down
Loading
Loading