From 3e497f5e2b1a1f0d1db59785997220de89a33aac Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 27 Apr 2026 21:55:39 +0100 Subject: [PATCH] fix: accept cron delivery thread ids --- src/gateway/protocol/cron-validators.test.ts | 37 ++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/gateway/protocol/cron-validators.test.ts b/src/gateway/protocol/cron-validators.test.ts index 1de9db206b9..3d869131580 100644 --- a/src/gateway/protocol/cron-validators.test.ts +++ b/src/gateway/protocol/cron-validators.test.ts @@ -54,6 +54,43 @@ describe("cron protocol validators", () => { expect(validateCronUpdateParams({ jobId: "job-2", patch: { enabled: true } })).toBe(true); }); + it("accepts delivery threadId on add and update params", () => { + expect( + validateCronAddParams({ + ...minimalAddParams, + delivery: { + mode: "announce", + channel: "telegram", + to: "-100123", + threadId: 42, + }, + }), + ).toBe(true); + expect( + validateCronUpdateParams({ + id: "job-1", + patch: { + delivery: { + mode: "announce", + channel: "telegram", + to: "-100123", + threadId: "topic-42", + }, + }, + }), + ).toBe(true); + expect( + validateCronUpdateParams({ + id: "job-1", + patch: { + delivery: { + threadId: 42, + }, + }, + }), + ).toBe(true); + }); + it("accepts remove params for id and jobId selectors", () => { expect(validateCronRemoveParams({ id: "job-1" })).toBe(true); expect(validateCronRemoveParams({ jobId: "job-2" })).toBe(true);