Bound long-lived frontend history caches

This commit is contained in:
rcourtman
2026-07-23 23:49:31 +01:00
parent 952e593d74
commit c77571685d
8 changed files with 363 additions and 26 deletions
@@ -141,6 +141,7 @@ work extends shared components instead of creating new local variants.
109. `frontend-modern/src/components/shared/summaryInteractionA11y.ts`
110. `frontend-modern/src/components/shared/SummaryRowActionButton.tsx`
111. `frontend-modern/src/hooks/createNonSuspendingQuery.ts`
111a. `frontend-modern/src/utils/storageSummaryCache.ts`
112. `frontend-modern/src/components/shared/TableCardHeader.tsx`
113. `frontend-modern/src/components/shared/UpgradeLink.tsx`
114. `frontend-modern/src/components/shared/useUpgradeNavigation.ts`
@@ -2748,6 +2749,15 @@ surface instead of falling through the app-level `Loading view...` fallback.
Feature slices such as recovery and infrastructure drawers may consume that
helper, but they must not fork new suspense-escape helpers once the shared
contract exists.
That retained-value boundary is explicitly bounded for long-lived browser
sessions. Fulfilled resource/range queries use a 64-entry LRU with a five-minute
inactive lifetime, clear on organization changes, and reject late old-scope
completions from the shared cache. Large storage summary history follows the
same ownership rule through `frontend-modern/src/utils/storageSummaryCache.ts`:
it keeps at most 20 recent node/range summaries and aborts in-flight requests
when organization ownership changes. Drawer navigation, chart range churn,
background tabs, reconnects, and server restarts must not turn either cache
into an append-only browser history.
The settings reporting shell now also owns a deliberate split between
historical performance reports and current-state VM inventory export.
`frontend-modern/src/components/Settings/ReportingPanel.tsx`,
@@ -4610,6 +4610,7 @@
"frontend-modern/src/utils/sourcePlatformOptions.ts",
"frontend-modern/src/utils/sourcePlatforms.ts",
"frontend-modern/src/utils/ssoProviderPresentation.ts",
"frontend-modern/src/utils/storageSummaryCache.ts",
"frontend-modern/src/utils/systemLogsPresentation.ts",
"frontend-modern/src/utils/systemSettingsPresentation.ts",
"frontend-modern/src/utils/textPresentation.ts",
@@ -5035,15 +5036,18 @@
},
{
"id": "retained-value-query-helper",
"label": "retained-value query helper proof",
"label": "retained-value and storage history cache proof",
"match_prefixes": [],
"match_files": [
"frontend-modern/src/hooks/createNonSuspendingQuery.ts"
"frontend-modern/src/hooks/createNonSuspendingQuery.ts",
"frontend-modern/src/utils/storageSummaryCache.ts"
],
"allow_same_subsystem_tests": false,
"test_prefixes": [],
"exact_files": [
"frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx"
"frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx",
"frontend-modern/src/hooks/__tests__/createNonSuspendingQuery.test.tsx",
"frontend-modern/src/utils/__tests__/storageSummaryCache.test.ts"
]
},
{
@@ -1803,7 +1803,11 @@ must not treat starter
bounded in-memory cache for same-tab remounts, but its cache key must carry
an explicit summary contract version so long-lived demo sessions do not
rehydrate stale pool or disk sparkline shapes after the storage summary
chart model changes.
chart model changes. The shared storage history owner at
`frontend-modern/src/utils/storageSummaryCache.ts` must likewise remain
bounded to 20 recent node/range summaries, use LRU replacement, and abort
in-flight requests when organization ownership changes so a late response
cannot recreate an old-scope cache entry.
19. Keep cross-surface workload handoffs on canonical IDs too. Shared workload
chart transport may look up provider-backed VM history through unified
metrics targets, but infrastructure/workloads/storage/recovery navigation
@@ -1897,6 +1901,16 @@ that Safe auto-fix or Autopilot remediation is verified.
## Current State
### Storage history remount state is bounded
Storage summary history no longer treats every node/range combination visited
by an always-open tab as permanent browser state. The shared cache keeps 20
recent summaries, refreshes LRU order on reuse, and cancels outstanding chart
requests during an organization switch. This cache is separate from backend
metrics-history retention and recovery-ingest ownership: increasing backup
polling or server-side recovery enumeration must not expand the browser cache
outside the fixed remount budget.
### vSphere member composition is inventory, not protection evidence
ESXi host members projected under a vCenter connection in the grouped