chore(per-instance-hook-scoping): archive verified+synced change
Move to openspec/changes/archive/2026-07-09-per-instance-hook-scoping/ (R100 renames preserved). 9 artifacts. Canonical openspec/specs/ service-instance-scoping/ remains. Resolves multi-instance wrong-data bug (hooks now scope by instance.id; instance switcher re-scopes). Carry-overs: fetchBackupDashboard untouched (design decision 5); subquery scoping for runs/alerts (schema asymmetry).
This commit is contained in:
@@ -110,7 +110,9 @@ export function AlertsTab({ instance }: { instance: ServiceInstance }) {
|
||||
isLoading: alertsLoading,
|
||||
error: alertsError,
|
||||
} = useAlertmanagerAlerts(instance.id);
|
||||
const { data: status, isLoading: statusLoading } = useAlertmanagerStatus(instance.id);
|
||||
const { data: status, isLoading: statusLoading } = useAlertmanagerStatus(
|
||||
instance.id,
|
||||
);
|
||||
|
||||
const statusDetail = status?.up
|
||||
? status.version
|
||||
|
||||
@@ -58,12 +58,12 @@ vi.mock("../../../hooks/useObservability", () => ({
|
||||
describe("AlertsTab", () => {
|
||||
it("passes instance.id to scoped hooks", () => {
|
||||
render(<AlertsTab instance={instance} />);
|
||||
expect(vi.mocked(useObservability.useAlertmanagerAlerts)).toHaveBeenCalledWith(
|
||||
"am-1",
|
||||
);
|
||||
expect(vi.mocked(useObservability.useAlertmanagerStatus)).toHaveBeenCalledWith(
|
||||
"am-1",
|
||||
);
|
||||
expect(
|
||||
vi.mocked(useObservability.useAlertmanagerAlerts),
|
||||
).toHaveBeenCalledWith("am-1");
|
||||
expect(
|
||||
vi.mocked(useObservability.useAlertmanagerStatus),
|
||||
).toHaveBeenCalledWith("am-1");
|
||||
});
|
||||
|
||||
it("renders the alert count and alert names", () => {
|
||||
|
||||
Reference in New Issue
Block a user