fix(testing): use UUIDs for macOS Discord smoke nonces · openclaw/openclaw@1914cc3
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | // Macos Discord script supports OpenClaw repository automation. |
| 2 | +import { randomUUID } from "node:crypto"; |
2 | 3 | import { readFile, writeFile } from "node:fs/promises"; |
3 | 4 | import path from "node:path"; |
4 | 5 | import type { MacosGuest } from "./guest-transports.ts"; |
@@ -58,7 +59,7 @@ ${this.input.guestNode} ${this.input.guestOpenClawEntry} channels status --probe
|
58 | 59 | } |
59 | 60 | |
60 | 61 | async runRoundtrip(phase: DiscordSmokePhase): Promise<void> { |
61 | | -const nonce = `${Date.now()}-${Math.floor(Math.random() * 100000)}`; |
| 62 | +const nonce = randomUUID(); |
62 | 63 | const outboundNonce = `${phase}-out-${nonce}`; |
63 | 64 | const inboundNonce = `${phase}-in-${nonce}`; |
64 | 65 | const outboundLog = path.join(this.input.runDir, `${phase}.discord-send.json`); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1136,6 +1136,8 @@ if (isPrlctl) {
|
1136 | 1136 | expect(macos).toContain("MacosDiscordSmoke"); |
1137 | 1137 | expect(macos).not.toContain("Authorization: Bot"); |
1138 | 1138 | expect(discord).toContain("Authorization: Bot"); |
| 1139 | +expect(discord).toContain('import { randomUUID } from "node:crypto"'); |
| 1140 | +expect(discord).not.toContain("Math.random()"); |
1139 | 1141 | expect(discord).toContain('"--silent"'); |
1140 | 1142 | expect(discord).toContain("doctor --fix --yes --non-interactive"); |
1141 | 1143 | expect(discord).toContain("channels status --probe --json"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。