fix(cli): make app-info cache resilient to corrupt entries + route errors through structured envelope (WTA-257) (#37852)

This commit is contained in:
Xiyuan Chen authored and GitHub committed 2026-06-24 07:39:26 +00:00
1 parent 2112115962
commit 32dc9ff2d9
5 files changed
+144 -28

No files matched your search

+12 -2
View File
@@ -74,8 +74,18 @@ async function readEntries(store: Store): Promise<Map<string, AppMetaCacheRecord
catch {
return out
}
for (const [k, e] of Object.entries(raw))
out.set(k, deserialize(e))
// A scalar/array survives Object.entries as garbage rather than throwing.
if (raw === null || typeof raw !== 'object' || Array.isArray(raw))
return out
for (const [k, e] of Object.entries(raw)) {
try {
out.set(k, deserialize(e))
}
catch {
// Drop unreadable entry → becomes a cache miss → consumer refetches.
}
}
return out
}