Skip to content

Commit 7a40d99

Browse files
committed
refactor(cron): extract delivery dispatch + harden reset notices
1 parent fe62711 commit 7a40d99

3 files changed

Lines changed: 481 additions & 302 deletions

File tree

src/auto-reply/reply/get-reply-run.media-only.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,4 +221,32 @@ describe("runPreparedReply media-only handling", () => {
221221
expect(resetNoticeCall?.payload?.text).not.toContain("api-key");
222222
expect(resetNoticeCall?.payload?.text).not.toContain("env:");
223223
});
224+
225+
it("skips reset notice when only webchat fallback routing is available", async () => {
226+
await runPreparedReply(
227+
baseParams({
228+
resetTriggered: true,
229+
ctx: {
230+
Body: "",
231+
RawBody: "",
232+
CommandBody: "",
233+
ThreadHistoryBody: "Earlier message in this thread",
234+
OriginatingChannel: undefined,
235+
OriginatingTo: undefined,
236+
ChatType: "group",
237+
},
238+
command: {
239+
isAuthorizedSender: true,
240+
abortKey: "session-key",
241+
ownerList: [],
242+
senderIsOwner: false,
243+
channel: "webchat",
244+
from: undefined,
245+
to: undefined,
246+
} as never,
247+
}),
248+
);
249+
250+
expect(vi.mocked(routeReply)).not.toHaveBeenCalled();
251+
});
224252
});

0 commit comments

Comments
 (0)