diff --git a/src/Web/StellaOps.Web/src/app/features/policy-studio/services/policy-pack.store.ts b/src/Web/StellaOps.Web/src/app/features/policy-studio/services/policy-pack.store.ts index a2f2d9816..85db19320 100644 --- a/src/Web/StellaOps.Web/src/app/features/policy-studio/services/policy-pack.store.ts +++ b/src/Web/StellaOps.Web/src/app/features/policy-studio/services/policy-pack.store.ts @@ -98,7 +98,13 @@ export class PolicyPackStore { const raw = sessionStorage.getItem(this.cacheKey); if (!raw) return null; const parsed = JSON.parse(raw) as PolicyPackSummary[]; - return Array.isArray(parsed) && parsed.length > 0 ? parsed : null; + if (!Array.isArray(parsed) || parsed.length === 0) return null; + // Reject stale cache entries that have packId instead of id (old API format) + if (!parsed[0].id && (parsed[0] as any).packId) { + sessionStorage.removeItem(this.cacheKey); + return null; + } + return parsed; } catch { return null; }