fix(agent): bound SCADA presentation continuations
Generic Container CI/CD / test-build-publish (push) Successful in 1m7s
Agent CI/CD / build-test-publish-and-deploy (push) Successful in 1m7s

This commit is contained in:
2026-11-12 12:22:07 +08:00
parent 0be30b80bb
commit f7e411c288
4 changed files with 27 additions and 2 deletions
+11
View File
@@ -27,6 +27,17 @@ it("continues an incomplete SCADA presentation with the exact missing device ins
expect(scadaPresentationContinuation(new Error("transport failed"))).toBeNull();
});
it("bounds repeated incomplete-presentation continuations within one run", async () => {
const { createScadaPresentationContinuation } = await import("../../src/product/operational-task-client.js");
const resume = createScadaPresentationContinuation();
const rejection = new OperationalTaskClientError(409, "缺少设备:524529", "SCADA_PRESENTATION_INCOMPLETE");
expect(resume(new Error("transport failed"))).toBeNull();
for (let attempt = 0; attempt < 3; attempt++) expect(resume(rejection)).toContain("524529");
expect(resume(rejection)).toBeNull();
expect(resume(rejection)).toBeNull();
expect(createScadaPresentationContinuation()(rejection)).toContain("524529");
});
it("keeps all-null current chunks aligned to their own first slot across midnight", () => {
for (const [start, end, labels, times] of [