mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix(telegram): move unchanged command-sync log to verbose
This commit is contained in:
@@ -179,10 +179,6 @@ describe("bot-native-command-menu", () => {
|
|||||||
botIdentity: "bot-a",
|
botIdentity: "bot-a",
|
||||||
});
|
});
|
||||||
|
|
||||||
await vi.waitFor(() => {
|
|
||||||
expect(runtimeLog).toHaveBeenCalledWith("telegram: command menu unchanged; skipping sync");
|
|
||||||
});
|
|
||||||
|
|
||||||
// setMyCommands should NOT have been called a second time.
|
// setMyCommands should NOT have been called a second time.
|
||||||
expect(setMyCommands).toHaveBeenCalledTimes(1);
|
expect(setMyCommands).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
@@ -213,7 +209,6 @@ describe("bot-native-command-menu", () => {
|
|||||||
botIdentity: "token-bot-b",
|
botIdentity: "token-bot-b",
|
||||||
});
|
});
|
||||||
await vi.waitFor(() => expect(setMyCommands).toHaveBeenCalledTimes(2));
|
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 () => {
|
it("does not cache empty-menu hash when deleteMyCommands fails", async () => {
|
||||||
@@ -244,7 +239,6 @@ describe("bot-native-command-menu", () => {
|
|||||||
botIdentity: "bot-a",
|
botIdentity: "bot-a",
|
||||||
});
|
});
|
||||||
await vi.waitFor(() => expect(deleteMyCommands).toHaveBeenCalledTimes(2));
|
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 () => {
|
it("retries with fewer commands on BOT_COMMANDS_TOO_MUCH", async () => {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
normalizeTelegramCommandName,
|
normalizeTelegramCommandName,
|
||||||
TELEGRAM_COMMAND_NAME_PATTERN,
|
TELEGRAM_COMMAND_NAME_PATTERN,
|
||||||
} from "../config/telegram-custom-commands.js";
|
} from "../config/telegram-custom-commands.js";
|
||||||
|
import { logVerbose } from "../globals.js";
|
||||||
import type { RuntimeEnv } from "../runtime.js";
|
import type { RuntimeEnv } from "../runtime.js";
|
||||||
import { withTelegramApiErrorLogging } from "./api-logging.js";
|
import { withTelegramApiErrorLogging } from "./api-logging.js";
|
||||||
|
|
||||||
@@ -169,7 +170,7 @@ export function syncTelegramMenuCommands(params: {
|
|||||||
const currentHash = hashCommandList(commandsToRegister);
|
const currentHash = hashCommandList(commandsToRegister);
|
||||||
const cachedHash = await readCachedCommandHash(accountId, botIdentity);
|
const cachedHash = await readCachedCommandHash(accountId, botIdentity);
|
||||||
if (cachedHash === currentHash) {
|
if (cachedHash === currentHash) {
|
||||||
runtime.log?.("telegram: command menu unchanged; skipping sync");
|
logVerbose("telegram: command menu unchanged; skipping sync");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user