From e4f448c74f641b28bbf5d7ce6f154d16152f0c0b Mon Sep 17 00:00:00 2001 From: Eldar Shlomi <72104254+eldar702@users.noreply.github.com> Date: Tue, 16 Jun 2026 13:47:31 +0300 Subject: [PATCH] fix(feishu): suppress log noise for bot_p2p_chat_entered_v1 event [AI-assisted] (#93574) Merged via squash. Prepared head SHA: 598af62d5bf08d482b190b90527b24893a992747 Co-authored-by: eldar702 <72104254+eldar702@users.noreply.github.com> Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com> Reviewed-by: @vincentkoc --- extensions/feishu/src/monitor.account.ts | 3 +++ .../feishu/src/monitor.webhook-e2e.test.ts | 26 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/extensions/feishu/src/monitor.account.ts b/extensions/feishu/src/monitor.account.ts index 65e5a531c38c..530e4fcb5125 100644 --- a/extensions/feishu/src/monitor.account.ts +++ b/extensions/feishu/src/monitor.account.ts @@ -306,6 +306,9 @@ function registerEventHandlers( "im.message.message_read_v1": async () => { // Ignore read receipts }, + "im.chat.access_event.bot_p2p_chat_entered_v1": async () => { + // Ignore p2p chat entry notifications — no action needed + }, "im.chat.member.bot.added_v1": async (data) => { try { const event = parseFeishuBotAddedEventPayload(data); diff --git a/extensions/feishu/src/monitor.webhook-e2e.test.ts b/extensions/feishu/src/monitor.webhook-e2e.test.ts index c95a907a1c95..ee71bce82841 100644 --- a/extensions/feishu/src/monitor.webhook-e2e.test.ts +++ b/extensions/feishu/src/monitor.webhook-e2e.test.ts @@ -363,6 +363,32 @@ describe("Feishu webhook signed-request e2e", () => { ); }); + it("does not emit unhandled-event warning for bot_p2p_chat_entered_v1", async () => { + probeFeishuMock.mockResolvedValue({ ok: true, botOpenId: "bot_open_id" }); + + await withRunningWebhookMonitor( + { + accountId: "p2p-chat-entered", + path: "/hook-e2e-p2p-chat-entered", + verificationToken: "verify_token", + encryptKey: "encrypt_key", + }, + monitorFeishuProvider, + async (url) => { + const payload = { + schema: "2.0", + header: { event_type: "im.chat.access_event.bot_p2p_chat_entered_v1" }, + event: {}, + }; + const response = await postSignedPayload(url, payload); + + expect(response.status).toBe(200); + const body = await response.text(); + expect(body).not.toContain("no im.chat.access_event.bot_p2p_chat_entered_v1 event handle"); + }, + ); + }); + it("accepts signed encrypted url_verification challenges end-to-end", async () => { probeFeishuMock.mockResolvedValue({ ok: true, botOpenId: "bot_open_id" });