mirror of
https://github.com/langgenius/dify.git
synced 2026-10-04 13:47:55 +08:00
fix(cli): make app-info cache resilient to corrupt entries + route errors through structured envelope (WTA-257) (#37852)
This commit is contained in:
1 parent
2112115962
commit
32dc9ff2d9
5 files changed
+144
-28
No files matched your search
Vendored
+12
-2
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user