mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 04:09:02 +00:00
feishu: fall back to user_id for inbound sender identity (openclaw#26703) thanks @NewdlDewdl
Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: NewdlDewdl <230946873+NewdlDewdl@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -59,6 +59,15 @@ describe("parseFeishuMessageEvent – mentionedBot", () => {
|
||||
expect(ctx.mentionedBot).toBe(false);
|
||||
});
|
||||
|
||||
it("falls back to sender user_id when open_id is missing", () => {
|
||||
const event = makeEvent("p2p", []);
|
||||
(event as any).sender.sender_id = { user_id: "u_mobile_only" };
|
||||
|
||||
const ctx = parseFeishuMessageEvent(event as any, BOT_OPEN_ID);
|
||||
expect(ctx.senderOpenId).toBe("u_mobile_only");
|
||||
expect(ctx.senderId).toBe("u_mobile_only");
|
||||
});
|
||||
|
||||
it("returns mentionedBot=true when bot is mentioned", () => {
|
||||
const event = makeEvent("group", [
|
||||
{ key: "@_user_1", name: "Bot", id: { open_id: BOT_OPEN_ID } },
|
||||
|
||||
Reference in New Issue
Block a user