






















@@ -181,7 +181,7 @@ describe("Feishu card-action lifecycle", () => {
181181expect.objectContaining({
182182accountId: "acct-card",
183183chatId: "p2p:ou_user1",
184-replyToMessageId: "card-action-tok-card-once",
184+replyToMessageId: undefined,
185185}),
186186);
187187expect(finalizeInboundContextMock).toHaveBeenCalledWith(
@@ -233,7 +233,12 @@ describe("Feishu card-action lifecycle", () => {
233233expect.objectContaining({
234234accountId: "acct-card",
235235 chatId,
236-replyToMessageId: "card-action-tok-card-v2-context",
236+replyToMessageId: "om_card_v2",
237+}),
238+);
239+expect(finalizeInboundContextMock).toHaveBeenCalledWith(
240+expect.objectContaining({
241+MessageSid: "card-action-tok-card-v2-context",
237242}),
238243);
239244});
@@ -261,7 +266,42 @@ describe("Feishu card-action lifecycle", () => {
261266expect.objectContaining({
262267accountId: "acct-card",
263268chatId: "ou_user1",
264-replyToMessageId: "card-action-tok-card-sdk-flat",
269+replyToMessageId: "om_sdk_card",
270+}),
271+);
272+expect(finalizeInboundContextMock).toHaveBeenCalledWith(
273+expect.objectContaining({
274+MessageSid: "card-action-tok-card-sdk-flat",
275+}),
276+);
277+});
278+279+it("plain-sends card action replies when Feishu provides no real message id", async () => {
280+const onCardAction = await setupLifecycleMonitor();
281+282+await onCardAction({
283+open_id: "ou_user1",
284+token: "tok-card-no-reply-target",
285+action: {
286+tag: "button",
287+value: {
288+command: "/help",
289+},
290+},
291+});
292+293+expect(lastRuntime?.error).not.toHaveBeenCalled();
294+expect(dispatchReplyFromConfigMock).toHaveBeenCalledTimes(1);
295+expect(createFeishuReplyDispatcherMock).toHaveBeenCalledWith(
296+expect.objectContaining({
297+accountId: "acct-card",
298+chatId: "ou_user1",
299+replyToMessageId: undefined,
300+}),
301+);
302+expect(finalizeInboundContextMock).toHaveBeenCalledWith(
303+expect.objectContaining({
304+MessageSid: "card-action-tok-card-no-reply-target",
265305}),
266306);
267307});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。