fix(plugins): only memoize complete metadata snapshots · openclaw/openclaw@3137622
steipete
·
2026-05-26
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -568,7 +568,17 @@ function canMemoizePluginMetadataSnapshotResult(result: {
|
568 | 568 | registrySource: PluginRegistrySnapshotSource; |
569 | 569 | snapshot: PluginMetadataSnapshot; |
570 | 570 | }): boolean { |
571 | | -return result.snapshot.plugins.length > 0 || result.snapshot.index.plugins.length > 0; |
| 571 | +const snapshot = result.snapshot; |
| 572 | +const hasCompleteSnapshotShape = |
| 573 | +Array.isArray(snapshot.plugins) && |
| 574 | +Array.isArray(snapshot.diagnostics) && |
| 575 | +Array.isArray(snapshot.registryDiagnostics) && |
| 576 | +Array.isArray(snapshot.manifestRegistry.plugins) && |
| 577 | +Array.isArray(snapshot.manifestRegistry.diagnostics) && |
| 578 | +Array.isArray(snapshot.index.plugins) && |
| 579 | +Array.isArray(snapshot.index.diagnostics); |
| 580 | +const hasPluginMetadata = snapshot.plugins.length > 0 || snapshot.index.plugins.length > 0; |
| 581 | +return hasCompleteSnapshotShape && hasPluginMetadata; |
572 | 582 | } |
573 | 583 | |
574 | 584 | export function resolvePluginMetadataSnapshot( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。