mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-26 00:23:33 +00:00
fix(feishu): harden target routing, dedupe, and reply fallback
This commit is contained in:
@@ -1188,6 +1188,38 @@ describe("handleFeishuMessage command authorization", () => {
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("does not dispatch twice for the same image message_id (concurrent dedupe)", async () => {
|
||||
mockShouldComputeCommandAuthorized.mockReturnValue(false);
|
||||
|
||||
const cfg: ClawdbotConfig = {
|
||||
channels: {
|
||||
feishu: {
|
||||
dmPolicy: "open",
|
||||
},
|
||||
},
|
||||
} as ClawdbotConfig;
|
||||
|
||||
const event: FeishuMessageEvent = {
|
||||
sender: {
|
||||
sender_id: {
|
||||
open_id: "ou-image-dedup",
|
||||
},
|
||||
},
|
||||
message: {
|
||||
message_id: "msg-image-dedup",
|
||||
chat_id: "oc-dm",
|
||||
chat_type: "p2p",
|
||||
message_type: "image",
|
||||
content: JSON.stringify({
|
||||
image_key: "img_dedup_payload",
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
await Promise.all([dispatchMessage({ cfg, event }), dispatchMessage({ cfg, event })]);
|
||||
expect(mockDispatchReplyFromConfig).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("toMessageResourceType", () => {
|
||||
|
||||
Reference in New Issue
Block a user