From 122fb924e2bb9d3d09f5d02c6087567d27494fdb Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 13 Feb 2026 18:30:28 +0100 Subject: [PATCH] fix: correct whatsapp send-api test mock path (openclaw#15594) thanks @TsekaLuk --- CHANGELOG.md | 1 + src/web/inbound/send-api.test.ts | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5809d0de463..a24d71f82e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Docs: https://docs.openclaw.ai - Security/Gateway: breaking default-behavior change - canvas IP-based auth fallback now only accepts machine-scoped addresses (RFC1918, link-local, ULA IPv6, CGNAT); public-source IP matches now require bearer token auth. (#14661) Thanks @sumleo. - Security/Gateway: sanitize and truncate untrusted WebSocket header values in pre-handshake close logs to reduce log-poisoning risk. Thanks @thewilloftheshadow. - Security/WhatsApp: enforce `0o600` on `creds.json` and `creds.json.bak` on save/backup/restore paths to reduce credential file exposure. (#10529) Thanks @abdelsfane. +- WhatsApp: preserve outbound document filenames for web-session document sends instead of always sending `"file"`. (#15594) Thanks @TsekaLuk. - Security/Gateway + ACP: block high-risk tools (`sessions_spawn`, `sessions_send`, `gateway`, `whatsapp_login`) from HTTP `/tools/invoke` by default with `gateway.tools.{allow,deny}` overrides, and harden ACP permission selection to fail closed when tool identity/options are ambiguous while supporting `allow_always`/`reject_always`. (#15390) Thanks @aether-ai-agent. - Gateway/Tools Invoke: sanitize `/tools/invoke` execution failures while preserving `400` for tool input errors and returning `500` for unexpected runtime failures, with regression coverage and docs updates. (#13185) Thanks @davidrudduck. - MS Teams: preserve parsed mention entities/text when appending OneDrive fallback file links, and accept broader real-world Teams mention ID formats (`29:...`, `8:orgid:...`) while still rejecting placeholder patterns. (#15436) Thanks @hyojin. diff --git a/src/web/inbound/send-api.test.ts b/src/web/inbound/send-api.test.ts index ef925ffddf1..9ef2486e041 100644 --- a/src/web/inbound/send-api.test.ts +++ b/src/web/inbound/send-api.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; const recordChannelActivity = vi.fn(); -vi.mock("../../../infra/channel-activity.js", () => ({ +vi.mock("../../infra/channel-activity.js", () => ({ recordChannelActivity: (...args: unknown[]) => recordChannelActivity(...args), })); @@ -31,6 +31,11 @@ describe("createWebSendApi", () => { mimetype: "application/pdf", }), ); + expect(recordChannelActivity).toHaveBeenCalledWith({ + channel: "whatsapp", + accountId: "main", + direction: "outbound", + }); }); it("falls back to default document filename when fileName is absent", async () => {