fix(cron): disable messaging tool when delivery.mode is none (#21808) (#21896)

This commit is contained in:
lailoo
2026-03-01 01:12:17 +08:00
committed by GitHub
parent e1df1c60b8
commit d7d3416b1d
3 changed files with 8 additions and 20 deletions

View File

@@ -43,29 +43,16 @@ describe("resolveCronDeliveryPlan", () => {
expect(plan.requested).toBe(false);
});
it("passes through accountId from delivery config", () => {
it("resolves mode=none with requested=false and no channel (#21808)", () => {
const plan = resolveCronDeliveryPlan(
makeJob({
delivery: {
mode: "announce",
channel: "telegram",
to: "-1003816714067",
accountId: "coordinator",
},
delivery: { mode: "none", to: "telegram:123" },
}),
);
expect(plan.mode).toBe("announce");
expect(plan.accountId).toBe("coordinator");
expect(plan.to).toBe("-1003816714067");
});
it("returns undefined accountId when not set", () => {
const plan = resolveCronDeliveryPlan(
makeJob({
delivery: { mode: "announce", channel: "telegram", to: "123" },
}),
);
expect(plan.accountId).toBeUndefined();
expect(plan.mode).toBe("none");
expect(plan.requested).toBe(false);
expect(plan.channel).toBeUndefined();
expect(plan.to).toBe("telegram:123");
});
it("resolves webhook mode without channel routing", () => {