Compare commits

..

2 Commits

Author SHA1 Message Date
F_ool c5b4728972
Merge f2e34b7422 into c4265a5f16 2026-03-15 14:35:29 +00:00
jianxh f2e34b7422 Fix CI for telegram proxy PR 2026-03-15 22:35:14 +08:00
3 changed files with 8 additions and 8 deletions

View File

@ -23,10 +23,7 @@ import type { RuntimeEnv } from "../../../../src/runtime.js";
import { loadWebMedia } from "../../../whatsapp/src/media.js";
import type { TelegramInlineButtons } from "../button-types.js";
import { splitTelegramCaption } from "../caption.js";
import {
shouldRetryTelegramIpv4Fallback,
type TelegramTransport,
} from "../fetch.js";
import { shouldRetryTelegramIpv4Fallback, type TelegramTransport } from "../fetch.js";
import {
markdownToTelegramChunks,
markdownToTelegramHtml,

View File

@ -221,7 +221,10 @@ function setCachedTelegramClientOptions(
return clientOptions;
}
function setCachedTelegramTransport(cacheKey: string, transport: TelegramTransport): TelegramTransport {
function setCachedTelegramTransport(
cacheKey: string,
transport: TelegramTransport,
): TelegramTransport {
telegramTransportCache.set(cacheKey, transport);
if (telegramTransportCache.size > MAX_TELEGRAM_CLIENT_OPTIONS_CACHE_SIZE) {
const oldestKey = telegramTransportCache.keys().next().value;

View File

@ -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 upsert = {
@ -265,7 +265,7 @@ describe("web monitor inbox", () => {
remoteJid: "999@s.whatsapp.net",
},
message: { conversation: "old message" },
messageTimestamp: nowSeconds(),
messageTimestamp: nowSeconds(-300_000),
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();
await listener.close();