test: simplify connected node collection · openclaw/openclaw@672426e
openclaw
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -84,7 +84,13 @@ async function getConnectedNodeIds(ws: WebSocket): Promise<string[]> {
|
84 | 84 | {}, |
85 | 85 | ); |
86 | 86 | expect(nodes.ok).toBe(true); |
87 | | -return (nodes.payload?.nodes ?? []).filter((n) => n.connected).map((n) => n.nodeId); |
| 87 | +const nodeIds: string[] = []; |
| 88 | +for (const node of nodes.payload?.nodes ?? []) { |
| 89 | +if (node.connected) { |
| 90 | +nodeIds.push(node.nodeId); |
| 91 | +} |
| 92 | +} |
| 93 | +return nodeIds; |
88 | 94 | } |
89 | 95 | |
90 | 96 | async function requestAllowOnceApproval( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。