Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Retain backup task origin independently of current guest placement

pulse-triage[bot]b31ef703b651
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index c3e459c0f0..9bef7ed10b 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -24,7 +24,16 @@
### Latest backup task evidence stays separate from recovery
Coverage’s existing expanded detail shows the scoped latest PVE task’s reported
-status, start, duration, full literal error and task ID. Long/multiline provider
+status, start, duration, full literal error and task ID. Each latest or possible
+latest task retains its own reported connection and native node, independent of
+the workload's current placement after migration. Missing task origins say Not
+reported; no workload, artifact reader or repository supplies them. Origin values
+wrap as literal text and remain searchable alongside the exposed task ID.
+Ordinary polling updates or clears them in the same open panel.
+`backupTaskOrigin.test.tsx` checks the inventory/model/consumer path for migration,
+namesake isolation, missing and literal origins, uncertain chronology, search
+and focused same-panel updates. The model's normal-suite origin test covers the
+same identity boundary. Matching, keys, posture and guest operations are unchanged. Long/multiline provider
text wraps without markup interpretation. An unreadable start says Unknown,
a missing duration says Not reported, and a failed task without error text
says Not reported. No task means no task section. Ordinary polling updates
diff --git a/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx
index 417199e3da..8eb7112c31 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx
@@ -217,12 +217,19 @@ const buildCoverageTaskSection = (task: CoverageTask, label: string): DetailSect
),
},
),
+ makeDetailRow('Task connection', task.instance || 'Not reported', { wrap: true }),
+ makeDetailRow('Task node', task.node || 'Not reported', { wrap: true }),
makeDetailRow('Task ID', task.id, { wrap: true }),
]),
footerContent: (
- <p class="whitespace-normal text-[11px] leading-snug text-muted wrap-anywhere">
- Task status does not verify a restore or guest responsiveness.
- </p>
+ <>
+ <p class="whitespace-normal text-[11px] leading-snug text-muted wrap-anywhere">
+ Task connection and node are reported by the task, not the workload’s current placement.
+ </p>
+ <p class="whitespace-normal text-[11px] leading-snug text-muted wrap-anywhere">
+ Task status does not verify a restore or guest responsiveness.
+ </p>
+ </>
),
});
diff --git a/frontend-modern/src/features/proxmox/__tests__/backupTaskOrigin.test.tsx b/frontend-modern/src/features/proxmox/__tests__/backupTaskOrigin.test.tsx
new file mode 100644
index 0000000000..4875fb27b8
--- /dev/null
+++ b/frontend-modern/src/features/proxmox/__tests__/backupTaskOrigin.test.tsx
@@ -0,0 +1,192 @@
+import { cleanup, fireEvent, render, screen, waitFor, within } from '@solidjs/testing-library';
+import { Route, Router } from '@solidjs/router';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import { resetCreateNonSuspendingQueryCacheForTest } from '@/hooks/createNonSuspendingQuery';
+import type { BackupTask } from '@/types/api';
+import type { Resource } from '@/types/resource';
+import { protectionPolicy } from '@/utils/__fixtures__/protectionPosture';
+import { ProxmoxBackupsTable } from '../ProxmoxBackupsTable';
+import { BACKUP_IDENTITY_NOW, identityGuest, identityTask } from '../__fixtures__/backupIdentity';
+
+const api = vi.hoisted(() => ({ fetch: vi.fn(), json: vi.fn(), width: 390 }));
+vi.mock('@/utils/apiClient', () => ({ apiFetch: api.fetch, apiFetchJSON: api.json }));
+vi.mock('@/hooks/useObservedElementWidth', () => ({
+ useObservedElementWidth: () => ({ setElement: () => {}, width: () => api.width }),
+}));
+let tasks: BackupTask[];
+let guests: Resource[];
+const response = (data: unknown) =>
+ new Response(JSON.stringify({ data }), { headers: { 'Content-Type': 'application/json' } });
+function mount() {
+ api.fetch.mockImplementation((url: string) =>
+ Promise.resolve(
+ response(
+ url === '/api/backups/pbs'
+ ? { backups: [] }
+ : { backupTasks: tasks, storageBackups: [], guestSnapshots: [] },
+ ),
+ ),
+ );
+ api.json.mockResolvedValue({ data: [], policy: protectionPolicy });
+ render(() => (
+ <Router>
+ <Route
+ path="/*"
+ component={() => <ProxmoxBackupsTable emptyIcon={<span />} workloads={guests} />}
+ />
+ </Router>
+ ));
+}
+async function open(scope = 'east') {
+ fireEvent.click(
+ await screen.findByRole('button', {
+ name: `Expand details for same-name (VM 100) · PVE connection: ${scope}`,
+ }),
+ );
+ return screen.findByTestId('proxmox-coverage-detail');
+}
+const section = (panel: HTMLElement, label = 'Latest task') =>
+ within(panel).getByText(label, { exact: true, selector: 'th' }).closest('tbody')!;
+const value = (parent: HTMLElement, label: string) =>
+ within(parent).getByText(label, { exact: true, selector: 'td' }).closest('tr')!.lastElementChild!;
+
+beforeEach(() => {
+ vi.resetAllMocks();
+ vi.useFakeTimers({ now: BACKUP_IDENTITY_NOW, toFake: ['Date', 'setInterval', 'clearInterval'] });
+ api.width = 390;
+ guests = ['east', 'west'].map((instance) => ({
+ ...identityGuest(`guest-${instance}`, instance, 'current-node'),
+ name: 'same-name',
+ displayName: 'same-name',
+ }));
+ tasks = [identityTask({ node: 'historical-node', status: 'failed', error: 'retained failure' })];
+ resetCreateNonSuspendingQueryCacheForTest();
+ window.history.replaceState({}, '', '/proxmox/backups/coverage');
+});
+afterEach(() => {
+ cleanup();
+ resetCreateNonSuspendingQueryCacheForTest();
+ vi.useRealTimers();
+});
+
+describe('task-reported origin through the inventory consumer', () => {
+ it.each([1200, 390, 320])(
+ 'keeps historical task origin separate from current placement at %ipx',
+ async (width) => {
+ api.width = width;
+ mount();
+ const panel = await open();
+ expect(value(section(panel, 'Workload'), 'Node')).toHaveTextContent('current-node');
+ expect(value(section(panel), 'Task node')).toHaveTextContent('historical-node');
+ expect(value(section(panel), 'Task connection')).toHaveTextContent('east');
+ expect(value(section(panel), 'Status')).toHaveTextContent('Failed');
+ expect(section(panel)).toHaveTextContent('not the workload’s current placement');
+ expect(section(panel)).toHaveTextContent(
+ 'Task status does not verify a restore or guest responsiveness.',
+ );
+ expect(api.fetch).toHaveBeenCalledTimes(2);
+ fireEvent.click(within(panel).getByRole('button', { name: 'Collapse same-name details' }));
+ const west = await open('west');
+ expect(west).not.toHaveTextContent('historical-node');
+ expect(within(west).queryByText('Latest task', { exact: true, selector: 'th' })).toBeNull();
+ },
+ );
+
+ it.each([
+ { instance: 'east', node: ' ' },
+ { instance: '', node: 'current-node' },
+ { instance: undefined, node: undefined },
+ ])('does not borrow a missing origin from the workload: $instance / $node', async (origin) => {
+ guests = [guests[0]];
+ tasks = [identityTask({ ...origin, type: 'vm' })];
+ mount();
+ const panel = await open();
+ expect(value(section(panel), 'Task connection').textContent).toBe(
+ origin.instance?.trim() || 'Not reported',
+ );
+ expect(value(section(panel), 'Task node').textContent).toBe(
+ origin.node?.trim() || 'Not reported',
+ );
+ expect(value(section(panel, 'Workload'), 'Node')).toHaveTextContent('current-node');
+ expect(value(section(panel, 'Workload'), 'PVE connection')).toHaveTextContent('east');
+ });
+
+ it('renders long provider node text literally without interpreting markup', async () => {
+ const node = '<img src=x onerror="throw 1">' + 'case-Sensitive-long-node-'.repeat(8);
+ tasks = [identityTask({ node })];
+ mount();
+ const cell = value(section(await open()), 'Task node');
+ expect(cell.textContent).toBe(node);
+ expect(cell.querySelector('img')).toBeNull();
+ expect(cell.firstElementChild).toHaveClass('whitespace-normal', 'wrap-break-word');
+ });
+
+ it('keeps the independent origins of every possible latest task', async () => {
+ tasks = [
+ tasks[0],
+ identityTask({ id: 'other-task', node: 'other-historical-node', startTime: 'invalid' }),
+ ];
+ mount();
+ const panel = await open();
+ expect(value(section(panel, 'Task order'), 'Latest task')).toHaveTextContent('Unknown');
+ const candidates = [
+ section(panel, 'Possible latest task 1'),
+ section(panel, 'Possible latest task 2'),
+ ];
+ expect(candidates.map((candidate) => value(candidate, 'Task node').textContent)).toEqual([
+ 'other-historical-node',
+ 'historical-node',
+ ]);
+ expect(
+ candidates.every((candidate) => value(candidate, 'Task connection').textContent === 'east'),
+ ).toBe(true);
+ });
+
+ it.each(['historical-node', 'task-100'])(
+ 'searches exposed task evidence without leaking into a namesake: %s',
+ async (term) => {
+ mount();
+ await screen.findByRole('button', { name: /Expand details for same-name.*east/ });
+ fireEvent.input(
+ screen.getByPlaceholder('Search backups by workload, node, source, or status'),
+ { target: { value: term } },
+ );
+ await waitFor(() => expect(window.location.search).toContain(term));
+ expect(
+ screen.getByRole('button', { name: /Expand details for same-name.*east/ }),
+ ).toBeInTheDocument();
+ expect(
+ screen.queryByRole('button', { name: /Expand details for same-name.*west/ }),
+ ).toBeNull();
+ },
+ );
+
+ it('updates and clears reported origins on ordinary polling with panel and focus intact', async () => {
+ mount();
+ const panel = await open();
+ const toggle = screen.getByRole('button', { name: /Collapse details for same-name.*east/ });
+ toggle.focus();
+ tasks = [identityTask({ node: 'new-task-node' })];
+ await vi.advanceTimersByTimeAsync(30_000);
+ await waitFor(() =>
+ expect(value(section(panel), 'Task node')).toHaveTextContent('new-task-node'),
+ );
+ expect(panel).not.toHaveTextContent('historical-node');
+ expect(value(section(panel), 'Status')).toHaveTextContent('OK');
+ tasks = [identityTask({ node: '', instance: '', type: 'vm' })];
+ // A single live candidate keeps the same workload key; its known current
+ // placement must not fill either missing task field.
+ guests.splice(1);
+ // Workloads are not reactive here, but the fresh model reads this array on
+ // the inventory poll, just as the production resources query replaces it.
+ await vi.advanceTimersByTimeAsync(30_000);
+ await waitFor(() =>
+ expect(value(section(panel), 'Task node')).toHaveTextContent('Not reported'),
+ );
+ expect(value(section(panel), 'Task connection')).toHaveTextContent('Not reported');
+ expect(value(section(panel, 'Workload'), 'Node')).toHaveTextContent('current-node');
+ expect(screen.getByTestId('proxmox-coverage-detail')).toBe(panel);
+ expect(document.activeElement).toBe(toggle);
+ expect(api.fetch).toHaveBeenCalledTimes(6);
+ });
+});
diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.test.ts
index f58723cb40..da2628e44f 100644
--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.test.ts
+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.test.ts
@@ -98,6 +98,23 @@ const protectionPosture = (resourceId: string, state: ProtectionState): Protecti
});
describe('proxmoxBackupRecoveryModel', () => {
+ it('retains task origin independently of migrated placement and exposed task search', () => {
+ const model = buildProxmoxBackupRecoveryModel({
+ workloads: [workload({})],
+ pbsBackups: [],
+ archives: [],
+ snapshots: [],
+ tasks: [task({ node: ' original-Node ' })],
+ nowMs: Date.parse('2026-05-26T00:00:00Z'),
+ });
+ const row = model.coverageRows[0];
+ expect(row.workload.nativeNode).toBe('minipc');
+ expect(row.latestTask).toMatchObject({ node: 'original-Node', instance: 'homelab' });
+ expect(coverageRowMatchesSearch(row, 'ORIGINAL-NODE')).toBe(true);
+ expect(coverageRowMatchesSearch(row, 'task-112')).toBe(true);
+ expect(row.posture).toBe('unknown');
+ });
+
it.each(['pbs-west', undefined])(
'searches the displayed backup connection independently of workload placement: %s',
(instance) => {
diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts b/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts
index bc29a438cd..9a1ae1c325 100644
--- a/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts
+++ b/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts
@@ -63,6 +63,9 @@ export interface CoverageTask {
startedMs?: number;
durationSeconds?: number;
error?: string;
+ /** Task-reported origin, independent of the workload's current placement. */
+ instance?: string;
+ node?: string;
}
export interface WorkloadCoverageRow {
@@ -763,6 +766,8 @@ export function buildProxmoxBackupRecoveryModel(
getRecoveryAgeBand(parsedStart, input.nowMs) === 'unknown' ? undefined : parsedStart,
durationSeconds: taskDurationSeconds(task),
error: task.error,
+ instance: task.instance?.trim() || undefined,
+ node: task.node?.trim() || undefined,
};
const rowTasks = tasksByWorkload.get(row.key) ?? [];
rowTasks.push(candidateTask);
@@ -839,9 +844,9 @@ export function coverageRowMatchesSearch(row: WorkloadCoverageRow, term: string)
...(row.workload.nativeNodeAliases ?? []),
row.workload.instance,
getWorkloadRecoveryPostureLabel(row.posture),
- row.latestTask?.label,
- row.latestTask?.error,
- ...(row.taskCandidates ?? []).flatMap((task) => [task.label, task.error, task.id]),
+ ...[...(row.latestTask ? [row.latestTask] : []), ...(row.taskCandidates ?? [])].flatMap(
+ (task) => [task.label, task.error, task.id, task.instance, task.node],
+ ),
...row.artifacts.flatMap((artifact) => [
artifact.sourceLabel,
artifact.sourceTitle,