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.

Expose latest backup failure evidence in workload Coverage

pulse-triage[bot]a8fc566d5e52
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index d652a352e5..8921d3c4a1 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -20,6 +20,23 @@
## Purpose
+### 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
+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
+and removes stale task details in the same keyed panel without losing focus.
+The detail explicitly does not verify a restore or guest responsiveness.
+
+`backupTaskEvidence.test.tsx` exercises the HTTP inventory parser, recovery
+model and production Coverage consumer at desktop/narrow layouts, namesake
+connection isolation, literal text, missing/invalid evidence, running/OK tasks
+and same-panel polling/removal. Desktop keyboard and narrow touch browser
+proof must inspect these existing details. No new read, route, task action,
+matching rule, protection policy, backup/restore or guest operation is added.
+
### Backup workload scope stays visible independently of its reader
Coverage retains the guest's PVE connection in its identity cell at every
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 233f040cf5..964548c186 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -21,6 +21,23 @@
## Purpose
+### 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
+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
+and removes stale task details in the same keyed panel without losing focus.
+The detail explicitly does not verify a restore or guest responsiveness.
+
+`backupTaskEvidence.test.tsx` exercises the HTTP inventory parser, recovery
+model and production Coverage consumer at desktop/narrow layouts, namesake
+connection isolation, literal text, missing/invalid evidence, running/OK tasks
+and same-panel polling/removal. Desktop keyboard and narrow touch browser
+proof must inspect these existing details. No new read, route, task action,
+matching rule, protection policy, backup/restore or guest operation is added.
+
### Backup workload scope stays visible independently of its reader
Coverage retains the guest's PVE connection in its identity cell at every
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index eef8e84597..07277c54f5 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -23,6 +23,23 @@ and sort the complete canonical change table while startup and ingestion wait.
## Purpose
+### 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
+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
+and removes stale task details in the same keyed panel without losing focus.
+The detail explicitly does not verify a restore or guest responsiveness.
+
+`backupTaskEvidence.test.tsx` exercises the HTTP inventory parser, recovery
+model and production Coverage consumer at desktop/narrow layouts, namesake
+connection isolation, literal text, missing/invalid evidence, running/OK tasks
+and same-panel polling/removal. Desktop keyboard and narrow touch browser
+proof must inspect these existing details. No new read, route, task action,
+matching rule, protection policy, backup/restore or guest operation is added.
+
### Backup workload scope stays visible independently of its reader
Coverage retains the guest's PVE connection in its identity cell at every
diff --git a/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx
index 5143b0f079..c7d23a7a74 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx
@@ -14,6 +14,7 @@ import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell, TableHead, TableRow } from '@/components/shared/Table';
import {
formatPlatformTableBytesValue,
+ formatPlatformTableDateTimeValue,
getPlatformTableCellClassForKind,
getPlatformTableHeadClassForKind,
PlatformDetailTable,
@@ -35,7 +36,7 @@ import {
type WorkloadCoverageRow,
} from './proxmoxBackupRecoveryModel';
import { proxmoxBackupWorkloadSubject } from './proxmoxBackupWorkloadSubject';
-import type { CoverageSortKey } from './proxmoxBackupsTableModel';
+import { formatDurationFromSeconds, type CoverageSortKey } from './proxmoxBackupsTableModel';
import {
ArtifactSourceIdentity,
ArtifactStateBadge,
@@ -193,13 +194,52 @@ const buildCoverageDetailSections = (row: WorkloadCoverageRow): DetailSection[]
makeDetailRow('PVE connection', getBackupWorkloadPVEConnection(row.workload), {
wrap: true,
}),
- makeDetailRow('Latest task', row.latestTask?.label, {
- tone: row.latestTask
- ? statusDetailTone(taskWordVariant(row.latestTask.label))
- : undefined,
- }),
]),
},
+ row.latestTask
+ ? {
+ label: 'Latest task',
+ rows: compactDetailRows([
+ makeDetailRow('Status', row.latestTask.label, {
+ tone: statusDetailTone(taskWordVariant(row.latestTask.label)),
+ }),
+ makeDetailRow(
+ 'Started',
+ row.latestTask.startedMs === undefined
+ ? 'Unknown'
+ : formatPlatformTableDateTimeValue(row.latestTask.startedMs),
+ { tone: row.latestTask.startedMs === undefined ? 'warning' : undefined },
+ ),
+ makeDetailRow(
+ 'Duration',
+ row.latestTask.durationSeconds === undefined
+ ? 'Not reported'
+ : row.latestTask.durationSeconds === 0
+ ? '0s'
+ : formatDurationFromSeconds(row.latestTask.durationSeconds),
+ ),
+ makeDetailRow(
+ 'Error',
+ row.latestTask.error?.trim() ||
+ (row.latestTask.label === 'Failed' ? 'Not reported' : undefined),
+ {
+ tone: 'danger',
+ valueContent: (
+ <span class="block whitespace-pre-wrap text-left font-normal leading-snug wrap-anywhere">
+ {row.latestTask.error?.trim() || 'Not reported'}
+ </span>
+ ),
+ },
+ ),
+ makeDetailRow('Task ID', row.latestTask.id, { wrap: true }),
+ ]),
+ footerContent: (
+ <p class="text-[11px] leading-snug text-muted wrap-anywhere">
+ Task status does not verify a restore or guest responsiveness.
+ </p>
+ ),
+ }
+ : null,
{
label: 'Provider evidence',
rows: compactDetailRows(
diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxCoverageTable.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxCoverageTable.test.tsx
index 6c7c3dbd52..3e99c49059 100644
--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxCoverageTable.test.tsx
+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxCoverageTable.test.tsx
@@ -132,9 +132,20 @@ describe('ProxmoxCoverageTable column visibility', () => {
});
it('keeps provider evidence in the workload drill-down instead of every table row', () => {
+ const completedWithWarning: WorkloadCoverageRow = {
+ ...row,
+ latestTask: {
+ id: 'task-with-warning',
+ label: 'OK',
+ status: 'OK',
+ startedAt: '2026-07-18T23:00:00Z',
+ startedMs: Date.parse('2026-07-18T23:00:00Z'),
+ error: 'Provider reported completion with a warning',
+ },
+ };
const { unmount } = renderInRouter(() => (
<ProxmoxCoverageTable
- rows={[row]}
+ rows={[completedWithWarning]}
hasAnyRows
emptyIcon={<span />}
emptyTitle=""
@@ -150,6 +161,7 @@ describe('ProxmoxCoverageTable column visibility', () => {
));
expect(document.body.textContent).not.toContain('Provider evidence');
+ expect(document.body.textContent).not.toContain(completedWithWarning.latestTask!.error);
expect(document.body.textContent).not.toContain(
'A current verified backup is available from complete provider history.',
);
@@ -157,7 +169,7 @@ describe('ProxmoxCoverageTable column visibility', () => {
renderInRouter(() => (
<ProxmoxCoverageTable
- rows={[row]}
+ rows={[completedWithWarning]}
hasAnyRows
emptyIcon={<span />}
emptyTitle=""
@@ -176,6 +188,16 @@ describe('ProxmoxCoverageTable column visibility', () => {
expect(document.body.textContent).toContain('Proxmox Backup Server');
expect(document.body.textContent).toContain('History Complete');
expect(document.body.textContent).toContain('Access Sufficient');
+ const task = screen.getByText('Latest task', { selector: 'th' }).closest('tbody')!;
+ expect(task).toHaveTextContent('OK');
+ expect(task).toHaveTextContent(completedWithWarning.latestTask!.error!);
+ expect(task).toHaveTextContent('task-with-warning');
+ expect(task).toHaveTextContent('Not reported');
+ // A reported OK does not erase a provider warning or override protection.
+ expect(screen.getByText(completedWithWarning.latestTask!.error!)).toHaveClass(
+ 'whitespace-pre-wrap',
+ 'wrap-anywhere',
+ );
});
it('keeps each provider scope beside its own access and history evidence', () => {
diff --git a/frontend-modern/src/features/proxmox/__tests__/backupTaskEvidence.test.tsx b/frontend-modern/src/features/proxmox/__tests__/backupTaskEvidence.test.tsx
new file mode 100644
index 0000000000..2f8633971b
--- /dev/null
+++ b/frontend-modern/src/features/proxmox/__tests__/backupTaskEvidence.test.tsx
@@ -0,0 +1,187 @@
+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, PVEBackupsPayload } from '@/types/api';
+import { protectionPolicy } from '@/utils/__fixtures__/protectionPosture';
+import { formatPlatformTableDateTimeValue } from '@/features/platformPage/sharedPlatformPage';
+import { ProxmoxBackupsTable } from '../ProxmoxBackupsTable';
+import {
+ BACKUP_IDENTITY_NOW,
+ identityArchive,
+ 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 }),
+}));
+
+const failure =
+ 'backup target unavailable\n<svg onload="throw 1">' + 'long-provider-detail-'.repeat(8);
+const failedTask = (extra: Partial<BackupTask> = {}) =>
+ identityTask({ status: 'failed', error: failure, ...extra });
+let tasks: BackupTask[];
+const guests = ['east', 'west'].map((instance) => ({
+ ...identityGuest(`guest-${instance}`, instance, 'pve-1'),
+ name: 'same-name',
+ displayName: 'same-name',
+}));
+const response = (data: unknown) =>
+ new Response(JSON.stringify({ data }), { headers: { 'Content-Type': 'application/json' } });
+function mount() {
+ api.fetch.mockImplementation((url: string) => {
+ const pve: PVEBackupsPayload = {
+ backupTasks: tasks,
+ storageBackups: [identityArchive()],
+ guestSnapshots: [],
+ };
+ return Promise.resolve(response(url === '/api/backups/pbs' ? { backups: [] } : pve));
+ });
+ // A provider task result cannot confer protection, even if it says OK.
+ api.json.mockResolvedValue({ data: [], policy: protectionPolicy });
+ render(() => (
+ <Router>
+ <Route
+ path="/*"
+ component={() => <ProxmoxBackupsTable emptyIcon={<span />} workloads={guests} />}
+ />
+ </Router>
+ ));
+}
+async function open(scope = 'east') {
+ const toggle = await screen.findByRole('button', {
+ name: `Expand details for same-name (VM 100) · PVE connection: ${scope}`,
+ });
+ fireEvent.click(toggle);
+ return screen.findByTestId('proxmox-coverage-detail');
+}
+const taskSection = (panel: HTMLElement) =>
+ within(panel).getByText('Latest task', { exact: true, selector: 'th' }).closest('tbody')!;
+const value = (section: HTMLElement, label: string) =>
+ within(section).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;
+ tasks = [failedTask()];
+ resetCreateNonSuspendingQueryCacheForTest();
+ window.history.replaceState({}, '', '/proxmox/backups/coverage');
+});
+afterEach(() => {
+ cleanup();
+ resetCreateNonSuspendingQueryCacheForTest();
+ vi.useRealTimers();
+});
+
+describe('latest backup task evidence through the inventory consumer', () => {
+ it.each([330, 1200])('exposes scoped, literal failure evidence at %ipx', async (width) => {
+ api.width = width;
+ mount();
+ const panel = await open();
+ const section = taskSection(panel);
+ expect(value(section, 'Status')).toHaveTextContent('Failed');
+ expect(value(section, 'Started')).toHaveTextContent(
+ formatPlatformTableDateTimeValue(Date.parse(tasks[0].startTime)),
+ );
+ expect(value(section, 'Duration')).toHaveTextContent('5m 0s');
+ expect(value(section, 'Task ID')).toHaveTextContent('task-100');
+ expect(value(section, 'Error').textContent).toBe(failure);
+ expect(value(section, 'Error').firstElementChild).toHaveClass(
+ 'whitespace-pre-wrap',
+ 'wrap-anywhere',
+ );
+ expect(value(section, 'Error').querySelector('svg')).toBeNull();
+ expect(section).toHaveTextContent(
+ 'Task status does not verify a restore or guest responsiveness.',
+ );
+ expect(panel).toHaveTextContent('Restore evidence');
+ expect(screen.getByRole('button', { name: '2 unknown' })).toBeInTheDocument();
+ expect(api.fetch).toHaveBeenCalledTimes(2);
+
+ fireEvent.click(within(panel).getByRole('button', { name: 'Collapse same-name details' }));
+ const other = await open('west');
+ expect(within(other).queryByText('Latest task', { exact: true, selector: 'th' })).toBeNull();
+ expect(other.textContent).not.toContain(failure);
+ expect(other).not.toHaveTextContent('task-100');
+ expect(api.fetch).toHaveBeenCalledTimes(2);
+ });
+
+ it('keeps missing failure text, invalid start and unordered duration explicit', async () => {
+ tasks = [failedTask({ error: ' ', startTime: 'invalid', endTime: 'also-invalid' })];
+ mount();
+ const section = taskSection(await open());
+ expect(value(section, 'Started')).toHaveTextContent('Unknown');
+ expect(value(section, 'Duration')).toHaveTextContent('Not reported');
+ expect(value(section, 'Error')).toHaveTextContent('Not reported');
+ expect(section).not.toHaveTextContent('Invalid Date');
+ expect(section).not.toHaveTextContent('also-invalid');
+ });
+
+ it.each([
+ { status: 'running', endTime: undefined, duration: 'Not reported' },
+ { status: 'OK', endTime: '2026-10-04T10:59:00Z', duration: 'Not reported' },
+ { status: 'OK', endTime: '2026-10-04T11:00:00.100Z', duration: '0s' },
+ ])('does not invent completion or protection for $status / $duration', async (extra) => {
+ tasks = [identityTask(extra)];
+ mount();
+ const section = taskSection(await open());
+ expect(value(section, 'Status')).toHaveTextContent(
+ extra.status === 'running' ? 'Running' : 'OK',
+ );
+ expect(value(section, 'Duration')).toHaveTextContent(extra.duration);
+ expect(within(section).queryByText('Error', { exact: true, selector: 'td' })).toBeNull();
+ expect(screen.getByRole('button', { name: '2 unknown' })).toBeInTheDocument();
+ expect(document.body).not.toHaveTextContent('A current verified backup is available.');
+ });
+
+ it('updates failure, recovery and task removal in the same open panel on ordinary polling', async () => {
+ mount();
+ const panel = await open();
+ expect(value(taskSection(panel), 'Error').textContent).toBe(failure);
+ const toggle = screen.getByRole('button', {
+ name: 'Collapse details for same-name (VM 100) · PVE connection: east',
+ });
+ toggle.focus();
+ const summary = toggle.closest('tr');
+ tasks = [
+ identityTask({
+ id: 'task-recovered',
+ startTime: '2026-10-04T11:30:00Z',
+ endTime: '2026-10-04T11:31:05Z',
+ }),
+ ];
+ await vi.advanceTimersByTimeAsync(30_000);
+ await waitFor(() =>
+ expect(value(taskSection(panel), 'Task ID')).toHaveTextContent('task-recovered'),
+ );
+ expect(value(taskSection(panel), 'Status')).toHaveTextContent('OK');
+ expect(value(taskSection(panel), 'Duration')).toHaveTextContent('1m 5s');
+ expect(
+ within(taskSection(panel)).queryByText('Error', { exact: true, selector: 'td' }),
+ ).toBeNull();
+ expect(panel.textContent).not.toContain(failure);
+ expect(screen.getByTestId('proxmox-coverage-detail')).toBe(panel);
+ expect(toggle.closest('tr')).toBe(summary);
+ expect(document.activeElement).toBe(toggle);
+ expect(screen.getByRole('button', { name: '2 unknown' })).toBeInTheDocument();
+ expect(api.fetch).toHaveBeenCalledTimes(4);
+
+ tasks = [];
+ await vi.advanceTimersByTimeAsync(30_000);
+ await waitFor(() =>
+ expect(within(panel).queryByText('Latest task', { exact: true, selector: 'th' })).toBeNull(),
+ );
+ expect(panel).not.toHaveTextContent('task-recovered');
+ expect(panel.textContent).not.toContain(failure);
+ expect(panel).toHaveTextContent('Restore evidence');
+ expect(screen.getByTestId('proxmox-coverage-detail')).toBe(panel);
+ expect(document.activeElement).toBe(toggle);
+ expect(api.fetch).toHaveBeenCalledTimes(6);
+ });
+});