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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Keep unknown backup sizes distinct from measured bytes
pulse-triage[bot]ecbd55339140
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex ee01e5a974..1bfbcbb8f6 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -20,6 +20,17 @@## Purpose+### Backup size uncertainty survives responsive disclosure++The Backups consumer uses the existing byte formatter only for a positive+reported size. Its row and open point explicitly label unavailable sizes rather+than hiding them; Coverage folds the same per-point fact beside its source when+the size column is hidden. Wrapping explanatory text keeps unknown distinct+from an empty point without adding a shared primitive or changing byte units,+layout breakpoints, control ownership or focus. Storage/recovery owns the size+admission and ordering. Normal Proxmox consumer tests and desktop/narrow browser+inspection cover the actual disclosure, including same-point polling.+### Selected PBS datastore remains inspectable without hoverThe existing PBS row disclosure is named by backup reader and datastore, ratherdiff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex 0ba8567256..b1077e6cbd 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -21,6 +21,30 @@## Purpose+### Unknown restore-point sizes stay unknown across inspection and sorting++Raw inventory retains the provider's reported size. The recovery view admits+only positive finite bytes for PBS snapshots, PVE backup files and guest+snapshots; a missing or zero size is unavailable evidence, not a measured+zero-byte point. Size sorting keeps those unknowns after known values in both+directions. Existing completed-point counts, verification, retention, protection,+known-volume chart semantics, identities, filters and requests do not change.++The By date row and its open detail explicitly say **Unknown size**, rather than+suggesting no size or hiding the field. The detail explains that unknown does+not mean an empty point. Coverage uses the same wording and explains its limit;+when the size column is hidden, each disclosed point keeps its size beside its+source. Ordinary polling updates the same inspected point and focus without+requiring a new request or dismissing unavailable data as zero.++Normal-suite `backupSizeEvidence.test.tsx` consumes parsed raw PVE/PBS inventory+and covers zero/missing/one-byte reports for all three sources, both sort+directions, desktop/phone disclosure and same-point polling. Existing activity+and inventory suites preserve chart/read semantics. Browser proof exercises+these raw responses through the actual consuming Backups surface at desktop and+narrow widths, including unknown/known transitions and inspected pixels. This+is truthful recovery evidence, not a restored guest or an installed backup test.+### Selected PBS datastore remains inspectable without hoverThe existing PBS row disclosure is named by backup reader and datastore, ratherdiff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex bf2992cef9..0408a50f6b 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -23,6 +23,18 @@ and sort the complete canonical change table while startup and ingestion wait.## Purpose+### Restore-point size is evidence, not identity or protection++The Backups consumer retains the same point/workload identity, provider state+and completed-point count when reported size becomes unavailable or is later+restored. Zero placeholders do not become measured zero-byte points or sort as+known sizes. Open By date/Coverage details expose unknown size without hiding+the record or changing its restore/protection meaning. Existing inline shells,+owner links, filters, polling and raw API evidence are unchanged. The registered+`ProxmoxBackupsTable.test.tsx` and normal `backupSizeEvidence.test.tsx` verify the+parsed consumer, count/state independence and stable open-point focus; browser+proof covers desktop/phone interactions and pixels.+### Selected PBS datastore remains inspectable without hoverThe existing PBS row disclosure is named by backup reader and datastore, ratherdiff --git a/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsxindex da47861607..993050fe54 100644--- a/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx+++ b/frontend-modern/src/features/proxmox/ProxmoxCoverageTable.tsx@@ -943,6 +943,16 @@ export function ProxmoxCoverageTable(props: {</Show></p></Show>+ <Show+ when={evidence().some(+ (artifact) => !(artifact.size && artifact.size > 0),+ )}+ >+ <p class="px-2 py-2 text-[11px] leading-snug text-muted whitespace-normal wrap-anywhere">+ Some restore-point sizes are unknown. Unknown does not mean+ those points are empty.+ </p>+ </Show><PlatformDetailTable class="table-fixed text-[11px]"><PlatformDetailTableHeader><TableHead class={getPlatformTableHeadClassForKind('name')}>@@ -1009,6 +1019,24 @@ export function ProxmoxCoverageTable(props: {Location: {artifact.location}</span></Show>+ <Show+ when={+ !isCoverageEvidenceColumnVisible(+ layoutMode(),+ 'size',+ )+ }+ >+ <span+ class="mt-1 block whitespace-normal text-muted leading-snug wrap-anywhere"+ data-coverage-evidence-size+ >+ Size:{' '}+ {artifact.size && artifact.size > 0+ ? formatPlatformTableBytesValue(artifact.size)+ : 'Unknown size'}+ </span>+ </Show></TableCell><Showwhen={isCoverageEvidenceColumnVisible(@@ -1045,7 +1073,9 @@ export function ProxmoxCoverageTable(props: {><Showwhen={artifact.size && artifact.size > 0}- fallback={<span class="text-muted">No size</span>}+ fallback={+ <span class="text-muted">Unknown size</span>+ }>{formatPlatformTableBytesValue(artifact.size)}</Show>diff --git a/frontend-modern/src/features/proxmox/ProxmoxRecoverableTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxRecoverableTable.tsxindex 902b3da36e..c0410718a4 100644--- a/frontend-modern/src/features/proxmox/ProxmoxRecoverableTable.tsx+++ b/frontend-modern/src/features/proxmox/ProxmoxRecoverableTable.tsx@@ -168,9 +168,19 @@ const buildRecoverableDetailSections = (artifact: RecoverableArtifact): DetailSe}),makeDetailRow('Size',- artifact.size && artifact.size > 0 ? formatPlatformTableBytesValue(artifact.size) : '',+ artifact.size && artifact.size > 0+ ? formatPlatformTableBytesValue(artifact.size)+ : 'Unknown size',+ { tone: artifact.size && artifact.size > 0 ? undefined : 'muted' },),]),+ footerContent: (+ <Show when={!(artifact.size && artifact.size > 0)}>+ <p class="whitespace-normal text-[11px] leading-snug text-muted wrap-anywhere">+ No usable size was reported. Unknown does not mean this restore point is empty.+ </p>+ </Show>+ ),},{label: 'State',@@ -387,7 +397,7 @@ export function ProxmoxRecoverableTable(props: {<TableCell class={`${getPlatformTableCellClassForKind('metric-bar')} text-base-content`}><Showwhen={artifact.size && artifact.size > 0}- fallback={<span class="text-muted">No size</span>}+ fallback={<span class="text-muted">Unknown size</span>}><RowMetricBarvaluePct={diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsxindex 089bf53057..2c54b50397 100644--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx@@ -2382,7 +2382,11 @@ describe('restore volume with unavailable sizes', () => {expect(screen.getAllByRole('button', { name: /: 0 B$/ }).length).toBeGreaterThan(0);await fireEvent.focus(today);expect(screen.getByText('3.00 KB known · 1 size unknown')).toBeInTheDocument();- expect(screen.getByText('Unknown size')).toBeInTheDocument();+ expect(+ within(document.querySelector<HTMLElement>('[data-tooltip-portal]')!).getByText(+ 'Unknown size',+ ),+ ).toBeInTheDocument();expect(screen.queryByText('1.00 KB (33%)')).not.toBeInTheDocument();await fireEvent.click(yesterday);expect(document.querySelectorAll('[data-proxmox-backup-row="recoverable"]')).toHaveLength(1);@@ -2395,6 +2399,25 @@ describe('restore volume with unavailable sizes', () => {).toBeInTheDocument();});+ it('[point-size] keeps unavailable size explicit without changing verification or completed counts', async () => {+ mountVolumeInventory();+ const toggle = await screen.findByRole('button', {+ name: /Expand details.*Identifier: pbs-100$/,+ });+ fireEvent.click(toggle);+ const panel = screen.getByTestId('proxmox-recoverable-detail');+ expect(within(panel).getByText('Size', { selector: 'td' }).closest('tr')).toHaveTextContent(+ 'Unknown size',+ );+ expect(panel).toHaveTextContent(+ 'No usable size was reported. Unknown does not mean this restore point is empty.',+ );+ expect(panel).not.toHaveTextContent('0 B');+ expect(within(panel).getAllByText('Verified')).toHaveLength(2);+ expect(document.body).toHaveTextContent('6 completed restore points');+ expect(document.body).toHaveTextContent('1 running');+ });+it('[volume-size] follows source scope without counting incomplete or out-of-window unknown sizes', async () => {mountVolumeInventory(true);await screen.findByRole('button', { name: /: 3 restore points$/ });diff --git a/frontend-modern/src/features/proxmox/__tests__/backupSizeEvidence.test.tsx b/frontend-modern/src/features/proxmox/__tests__/backupSizeEvidence.test.tsxnew file mode 100644index 0000000000..64c2858d18--- /dev/null+++ b/frontend-modern/src/features/proxmox/__tests__/backupSizeEvidence.test.tsx@@ -0,0 +1,211 @@+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 { protectionPolicy } from '@/utils/__fixtures__/protectionPosture';+import { ProxmoxBackupsTable } from '../ProxmoxBackupsTable';+import { buildProxmoxBackupRecoveryModel } from '../proxmoxBackupRecoveryModel';+import { parsePBSBackupInventory, parsePVEBackupInventory } from '../proxmoxBackupInventory';+import {+ BACKUP_IDENTITY_NOW,+ identityArchive,+ identityGuest,+ identityPBS,+ identitySnapshot,+} from '../__fixtures__/backupIdentity';++const api = vi.hoisted(() => ({ fetch: vi.fn(), json: vi.fn(), width: 1200 }));+vi.mock('@/utils/apiClient', () => ({ apiFetch: api.fetch, apiFetchJSON: api.json }));+vi.mock('@/hooks/useObservedElementWidth', () => ({+ useObservedElementWidth: () => ({ setElement: () => {}, width: () => api.width }),+}));++const guest = identityGuest('backup-size-guest', 'east', 'pve-1');+const payloads = (size: number | undefined) => ({+ pbs: { backups: [identityPBS({ size })] },+ pve: {+ backupTasks: [],+ storageBackups: [identityArchive({ size })],+ guestSnapshots: [identitySnapshot({ sizeBytes: size })],+ },+});+const response = (data: unknown) =>+ new Response(JSON.stringify({ data }), { headers: { 'Content-Type': 'application/json' } });++function mount(getPayloads = () => payloads(0)) {+ api.fetch.mockImplementation((url: string) =>+ Promise.resolve(response(url === '/api/backups/pbs' ? getPayloads().pbs : getPayloads().pve)),+ );+ // A size, verification result or completed point never invents a posture.+ api.json.mockResolvedValue({ data: [], policy: protectionPolicy });+ render(() => (+ <Router>+ <Route+ path="/*"+ component={() => <ProxmoxBackupsTable emptyIcon={<span />} workloads={[guest]} />}+ />+ </Router>+ ));+}+const rows = () =>+ Array.from(document.querySelectorAll<HTMLElement>('[data-proxmox-backup-row="recoverable"]'));+const pointRow = (id: string) =>+ screen+ .getByRole('button', { name: new RegExp(`Expand details.*Identifier: ${id}$`) })+ .closest('tr')!;+const sizeValue = (panel: HTMLElement) =>+ within(panel).getByText('Size', { exact: true, selector: 'td' }).closest('tr')!.lastElementChild!;+const sizeNotice =+ 'No usable size was reported. Unknown does not mean this restore point is empty.';++beforeEach(() => {+ vi.resetAllMocks();+ vi.useFakeTimers({ now: BACKUP_IDENTITY_NOW, toFake: ['Date', 'setInterval', 'clearInterval'] });+ resetCreateNonSuspendingQueryCacheForTest();+ api.width = 1200;+ window.history.replaceState({}, '', '/proxmox/backups/date');+});+afterEach(() => {+ cleanup();+ resetCreateNonSuspendingQueryCacheForTest();+ vi.useRealTimers();+});++describe('restore-point size evidence through parsed inventory', () => {+ it.each([0, undefined])('does not turn %s into measured zero bytes for any source', (size) => {+ const input = payloads(size);+ const pbs = parsePBSBackupInventory({ data: input.pbs });+ const pve = parsePVEBackupInventory({ data: input.pve });+ expect(pbs.backups[0].size).toBe(size);+ expect(pve.storageBackups[0].size).toBe(size);+ expect(pve.guestSnapshots[0].sizeBytes).toBe(size);+ const model = buildProxmoxBackupRecoveryModel({+ workloads: [guest],+ pbsBackups: pbs.backups,+ archives: pve.storageBackups,+ snapshots: pve.guestSnapshots,+ tasks: [],+ nowMs: BACKUP_IDENTITY_NOW,+ });+ expect(model.recoverableArtifacts.map((artifact) => artifact.size)).toEqual([+ undefined,+ undefined,+ undefined,+ ]);+ expect(model.coverageSummary.recoverableArtifacts).toBe(3);+ expect(model.coverageSummary.totalBytes).toBe(0); // Known-byte sum, not a measured fleet total.+ expect(model.coverageRows[0].posture).toBe('unknown');+ });++ it('preserves even a one-byte report for all three sources', () => {+ const input = payloads(1);+ const model = buildProxmoxBackupRecoveryModel({+ workloads: [guest],+ pbsBackups: parsePBSBackupInventory({ data: input.pbs }).backups,+ archives: parsePVEBackupInventory({ data: input.pve }).storageBackups,+ snapshots: parsePVEBackupInventory({ data: input.pve }).guestSnapshots,+ tasks: [],+ nowMs: BACKUP_IDENTITY_NOW,+ });+ expect(model.recoverableArtifacts.map((artifact) => artifact.size)).toEqual([1, 1, 1]);+ expect(model.coverageSummary.totalBytes).toBe(3);+ });++ it.each([1200, 320])(+ '[baseline-sensitive] keeps unknown size explicit in every open restore point at %ipx',+ async (width) => {+ api.width = width;+ mount();+ await waitFor(() => expect(rows()).toHaveLength(3));+ for (const row of rows()) {+ if (width === 1200) expect(within(row).getByText('Unknown size')).toBeInTheDocument();+ fireEvent.click(within(row).getByRole('button', { name: /Expand details/ }));+ const panel = screen.getByTestId('proxmox-recoverable-detail');+ expect(sizeValue(panel)).toHaveTextContent('Unknown size');+ expect(panel).toHaveTextContent(sizeNotice);+ expect(panel).not.toHaveTextContent('0 B');+ }+ expect(document.body).toHaveTextContent('3 completed restore points');+ expect(screen.getByRole('button', { name: '1 unknown' })).toBeInTheDocument();+ expect(api.fetch).toHaveBeenCalledTimes(2);+ },+ );++ it('[baseline-sensitive] sorts only measured sizes, keeping zero and absent reports last in both directions', async () => {+ mount(() => ({+ pbs: {+ backups: [+ identityPBS({ id: 'unknown-zero', size: 0 }),+ identityPBS({ id: 'unknown-missing', size: undefined }),+ identityPBS({ id: 'known-small', size: 1 }),+ identityPBS({ id: 'known-large', size: 4096 }),+ ],+ },+ pve: { backupTasks: [], storageBackups: [], guestSnapshots: [] },+ }));+ await waitFor(() => expect(rows()).toHaveLength(4));+ const order = () =>+ rows().map(+ (row) =>+ within(row)+ .getByRole('button', { name: /Expand details/ })+ .getAttribute('aria-label')!+ .split('Identifier: ')[1],+ );+ fireEvent.click(screen.getByRole('button', { name: 'Sort by Size' }));+ expect(order()).toEqual(['known-large', 'known-small', 'unknown-zero', 'unknown-missing']);+ fireEvent.click(screen.getByRole('button', { name: 'Sort by Size ascending' }));+ expect(order()).toEqual(['known-small', 'known-large', 'unknown-zero', 'unknown-missing']);+ expect(within(pointRow('known-small')).getByText(/^1(?:\.00)? B$/)).toBeInTheDocument();+ expect(api.fetch).toHaveBeenCalledTimes(2);+ });++ it.each([1200, 320])(+ 'keeps Coverage size evidence readable at %ipx without implying empty points',+ async (width) => {+ api.width = width;+ window.history.replaceState({}, '', '/proxmox/backups/coverage');+ mount();+ const toggle = await screen.findByRole('button', {+ name: /Expand details for backup-size-guest/,+ });+ fireEvent.click(toggle);+ const panel = screen.getByTestId('proxmox-coverage-detail');+ expect(panel).toHaveTextContent(+ 'Some restore-point sizes are unknown. Unknown does not mean those points are empty.',+ );+ expect(+ within(panel).getAllByText(width === 1200 ? 'Unknown size' : 'Size: Unknown size'),+ ).toHaveLength(3);+ expect(panel).not.toHaveTextContent('0 B');+ expect(api.fetch).toHaveBeenCalledTimes(2);+ },+ );++ it('updates the same open point from known to unknown and back on ordinary polls without losing focus', async () => {+ api.width = 320;+ let size = 2048;+ mount(() => payloads(size));+ await waitFor(() => expect(rows()).toHaveLength(3));+ const toggle = within(pointRow('pbs-100')).getByRole('button', { name: /Expand details/ });+ fireEvent.click(toggle);+ toggle.focus();+ const panel = screen.getByTestId('proxmox-recoverable-detail');+ expect(sizeValue(panel)).toHaveTextContent('2.00 KB');+ expect(panel).not.toHaveTextContent(sizeNotice);+ size = 0;+ await vi.advanceTimersByTimeAsync(30_000);+ expect(screen.getByTestId('proxmox-recoverable-detail')).toBe(panel);+ expect(sizeValue(panel)).toHaveTextContent('Unknown size');+ expect(panel).toHaveTextContent(sizeNotice);+ expect(document.activeElement).toBe(toggle);+ size = 4096;+ await vi.advanceTimersByTimeAsync(30_000);+ expect(screen.getByTestId('proxmox-recoverable-detail')).toBe(panel);+ expect(sizeValue(panel)).toHaveTextContent('4.00 KB');+ expect(panel).not.toHaveTextContent(sizeNotice);+ expect(document.activeElement).toBe(toggle);+ expect(api.fetch).toHaveBeenCalledTimes(6);+ });+});diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts b/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.tsindex eeaf1badae..5abfae231b 100644--- a/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts+++ b/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts@@ -42,6 +42,7 @@ export interface RecoverableArtifact extends BackupLocationScope {workload: WorkloadReference;createdAt: string;createdMs?: number;+ /** Positive reported bytes only. Missing/zero does not establish an empty point. */size?: number;location: string;detail: string;@@ -168,6 +169,12 @@ export function isCompletedRecoveryArtifact(artifact: RecoverableArtifact): boolreturn !artifact.running && !artifact.failed;}+// Zero is also the producer's missing-size placeholder. Keep it in the raw+// inventory, but not as a measured zero in the recovery view (including sorts).+function reportedSizeBytes(size: number | undefined): number | undefined {+ return size !== undefined && Number.isFinite(size) && size > 0 ? size : undefined;+}+function archiveFileName(volid: string | undefined): string {const trimmed = volid?.trim() ?? '';if (!trimmed) return '';@@ -687,7 +694,7 @@ export function buildProxmoxBackupRecoveryModel(workload,createdAt: backup.backupTime,createdMs,- size: backup.size,+ size: reportedSizeBytes(backup.size),location: `${backup.datastore || '—'} / ${backup.namespace?.trim() || '(root)'}`,...backupLocationScope('pbs', backup.instance, backup.datastore),detail: pbsBackupFileDetailLabel(backup.files.length),@@ -720,7 +727,7 @@ export function buildProxmoxBackupRecoveryModel(workload,createdAt: archive.time,createdMs,- size: archive.size,+ size: reportedSizeBytes(archive.size),location: archive.storage || archive.node || '—',...backupLocationScope('archive', archive.instance, archive.storage || archive.node),// The volid repeats the storage, guest type, VMID, and timestamp the row@@ -756,7 +763,7 @@ export function buildProxmoxBackupRecoveryModel(workload,createdAt: snapshot.time,createdMs,- size: snapshot.sizeBytes,+ size: reportedSizeBytes(snapshot.sizeBytes),location: snapshot.node || snapshot.instance || '—',...backupLocationScope('snapshot', snapshot.instance, snapshot.node),detail: snapshot.description || snapshot.name || snapshotSource.detailFallbackLabel,