fix(ci): reject unsafe boundary shard specs · openclaw/openclaw@4747e94
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -105,11 +105,11 @@ export function parseShardSpec(value) {
|
105 | 105 | if (!match) { |
106 | 106 | throw new Error(`Invalid shard spec '${value}' (expected N/TOTAL)`); |
107 | 107 | } |
108 | | -const index = Number.parseInt(match[1], 10); |
109 | | -const count = Number.parseInt(match[2], 10); |
| 108 | +const index = Number(match[1]); |
| 109 | +const count = Number(match[2]); |
110 | 110 | if ( |
111 | | -!Number.isInteger(index) || |
112 | | -!Number.isInteger(count) || |
| 111 | +!Number.isSafeInteger(index) || |
| 112 | +!Number.isSafeInteger(count) || |
113 | 113 | index < 1 || |
114 | 114 | count < 1 || |
115 | 115 | index > count |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -91,6 +91,7 @@ describe("run-additional-boundary-checks", () => {
|
91 | 91 | ); |
92 | 92 | expect(new Set(shardedLabels).size).toBe(BOUNDARY_CHECKS.length); |
93 | 93 | expect(() => parseShardSpec("5/4")).toThrow("Invalid shard spec"); |
| 94 | +expect(() => parseShardSpec("9007199254740993/9007199254740994")).toThrow("Invalid shard spec"); |
94 | 95 | }); |
95 | 96 | |
96 | 97 | it("keeps the raw HTTP/2 import guard in source boundary checks", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。