From 805de8537cba1a8418443bc61ae8b09900360d8d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 3 Mar 2026 03:05:25 +0000 Subject: [PATCH] fix(telegram): move unchanged command-sync log to verbose --- src/telegram/bot-native-command-menu.test.ts | 6 ------ src/telegram/bot-native-command-menu.ts | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/telegram/bot-native-command-menu.test.ts b/src/telegram/bot-native-command-menu.test.ts index d3fa114944c..6f0ced96dd5 100644 --- a/src/telegram/bot-native-command-menu.test.ts +++ b/src/telegram/bot-native-command-menu.test.ts @@ -179,10 +179,6 @@ describe("bot-native-command-menu", () => { botIdentity: "bot-a", }); - await vi.waitFor(() => { - expect(runtimeLog).toHaveBeenCalledWith("telegram: command menu unchanged; skipping sync"); - }); - // setMyCommands should NOT have been called a second time. expect(setMyCommands).toHaveBeenCalledTimes(1); }); @@ -213,7 +209,6 @@ describe("bot-native-command-menu", () => { botIdentity: "token-bot-b", }); await vi.waitFor(() => expect(setMyCommands).toHaveBeenCalledTimes(2)); - expect(runtimeLog).not.toHaveBeenCalledWith("telegram: command menu unchanged; skipping sync"); }); it("does not cache empty-menu hash when deleteMyCommands fails", async () => { @@ -244,7 +239,6 @@ describe("bot-native-command-menu", () => { botIdentity: "bot-a", }); await vi.waitFor(() => expect(deleteMyCommands).toHaveBeenCalledTimes(2)); - expect(runtimeLog).not.toHaveBeenCalledWith("telegram: command menu unchanged; skipping sync"); }); it("retries with fewer commands on BOT_COMMANDS_TOO_MUCH", async () => { diff --git a/src/telegram/bot-native-command-menu.ts b/src/telegram/bot-native-command-menu.ts index 6b29c5f9366..29f3465743f 100644 --- a/src/telegram/bot-native-command-menu.ts +++ b/src/telegram/bot-native-command-menu.ts @@ -8,6 +8,7 @@ import { normalizeTelegramCommandName, TELEGRAM_COMMAND_NAME_PATTERN, } from "../config/telegram-custom-commands.js"; +import { logVerbose } from "../globals.js"; import type { RuntimeEnv } from "../runtime.js"; import { withTelegramApiErrorLogging } from "./api-logging.js"; @@ -169,7 +170,7 @@ export function syncTelegramMenuCommands(params: { const currentHash = hashCommandList(commandsToRegister); const cachedHash = await readCachedCommandHash(accountId, botIdentity); if (cachedHash === currentHash) { - runtime.log?.("telegram: command menu unchanged; skipping sync"); + logVerbose("telegram: command menu unchanged; skipping sync"); return; }