mirror of https://github.com/openclaw/openclaw.git
Fix CI for telegram proxy PR
This commit is contained in:
parent
6f864e21fa
commit
f2e34b7422
|
|
@ -23,10 +23,7 @@ import type { RuntimeEnv } from "../../../../src/runtime.js";
|
||||||
import { loadWebMedia } from "../../../whatsapp/src/media.js";
|
import { loadWebMedia } from "../../../whatsapp/src/media.js";
|
||||||
import type { TelegramInlineButtons } from "../button-types.js";
|
import type { TelegramInlineButtons } from "../button-types.js";
|
||||||
import { splitTelegramCaption } from "../caption.js";
|
import { splitTelegramCaption } from "../caption.js";
|
||||||
import {
|
import { shouldRetryTelegramIpv4Fallback, type TelegramTransport } from "../fetch.js";
|
||||||
shouldRetryTelegramIpv4Fallback,
|
|
||||||
type TelegramTransport,
|
|
||||||
} from "../fetch.js";
|
|
||||||
import {
|
import {
|
||||||
markdownToTelegramChunks,
|
markdownToTelegramChunks,
|
||||||
markdownToTelegramHtml,
|
markdownToTelegramHtml,
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,10 @@ function setCachedTelegramClientOptions(
|
||||||
return clientOptions;
|
return clientOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCachedTelegramTransport(cacheKey: string, transport: TelegramTransport): TelegramTransport {
|
function setCachedTelegramTransport(
|
||||||
|
cacheKey: string,
|
||||||
|
transport: TelegramTransport,
|
||||||
|
): TelegramTransport {
|
||||||
telegramTransportCache.set(cacheKey, transport);
|
telegramTransportCache.set(cacheKey, transport);
|
||||||
if (telegramTransportCache.size > MAX_TELEGRAM_CLIENT_OPTIONS_CACHE_SIZE) {
|
if (telegramTransportCache.size > MAX_TELEGRAM_CLIENT_OPTIONS_CACHE_SIZE) {
|
||||||
const oldestKey = telegramTransportCache.keys().next().value;
|
const oldestKey = telegramTransportCache.keys().next().value;
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,7 @@ describe("web monitor inbox", () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("handles append messages by marking them read but skipping auto-reply", async () => {
|
it("handles stale append messages by marking them read but skipping auto-reply", async () => {
|
||||||
const { onMessage, listener, sock } = await openInboxMonitor();
|
const { onMessage, listener, sock } = await openInboxMonitor();
|
||||||
|
|
||||||
const upsert = {
|
const upsert = {
|
||||||
|
|
@ -265,7 +265,7 @@ describe("web monitor inbox", () => {
|
||||||
remoteJid: "999@s.whatsapp.net",
|
remoteJid: "999@s.whatsapp.net",
|
||||||
},
|
},
|
||||||
message: { conversation: "old message" },
|
message: { conversation: "old message" },
|
||||||
messageTimestamp: nowSeconds(),
|
messageTimestamp: nowSeconds(-300_000),
|
||||||
pushName: "History Sender",
|
pushName: "History Sender",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
@ -284,7 +284,7 @@ describe("web monitor inbox", () => {
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Verify it WAS NOT passed to onMessage
|
// Verify stale history sync messages are not passed to onMessage
|
||||||
expect(onMessage).not.toHaveBeenCalled();
|
expect(onMessage).not.toHaveBeenCalled();
|
||||||
|
|
||||||
await listener.close();
|
await listener.close();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue