test: tighten ui chat idempotency keys · openclaw/openclaw@39dfe4d
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -19,6 +19,8 @@ const { executeSlashCommandMock, setLastActiveSessionKeyMock } = vi.hoisted(() =
|
19 | 19 | setLastActiveSessionKeyMock: vi.fn(), |
20 | 20 | })); |
21 | 21 | |
| 22 | +const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu; |
| 23 | + |
22 | 24 | vi.mock("./app-last-active-session.ts", () => ({ |
23 | 25 | setLastActiveSessionKey: (...args: unknown[]) => setLastActiveSessionKeyMock(...args), |
24 | 26 | })); |
@@ -1120,7 +1122,7 @@ describe("handleSendChat", () => {
|
1120 | 1122 | sessionKey: "agent:main", |
1121 | 1123 | message: "/btw what changed?", |
1122 | 1124 | deliver: false, |
1123 | | -idempotencyKey: expect.any(String), |
| 1125 | +idempotencyKey: expect.stringMatching(uuidPattern), |
1124 | 1126 | }), |
1125 | 1127 | ); |
1126 | 1128 | expect(host.chatQueue).toStrictEqual([]); |
@@ -1337,7 +1339,7 @@ describe("handleSendChat", () => {
|
1337 | 1339 | sessionKey: "agent:main:main", |
1338 | 1340 | message: "tighten the plan", |
1339 | 1341 | deliver: false, |
1340 | | -idempotencyKey: expect.any(String), |
| 1342 | +idempotencyKey: expect.stringMatching(uuidPattern), |
1341 | 1343 | attachments: undefined, |
1342 | 1344 | }); |
1343 | 1345 | expect(host.chatRunId).toBe("run-1"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。