惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
B
Blog RSS Feed
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
Recent Announcements
Recent Announcements
A
About on SuperTechFans
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
Google DeepMind News
Google DeepMind News
S
Schneier on Security
S
Secure Thoughts
T
The Exploit Database - CXSecurity.com
Martin Fowler
Martin Fowler
P
Proofpoint News Feed
Security Latest
Security Latest
Jina AI
Jina AI
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Recorded Future
Recorded Future
T
Tor Project blog
有赞技术团队
有赞技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
News | PayPal Newsroom
博客园 - 三生石上(FineUI控件)
MyScale Blog
MyScale Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
Forbes - Security
Forbes - Security
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
NISL@THU
NISL@THU
C
Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Google DeepMind News
Google DeepMind News
Project Zero
Project Zero
IT之家
IT之家
T
Threatpost
Cyberwarzone
Cyberwarzone
O
OpenAI News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
J
Java Code Geeks
P
Proofpoint News Feed
The Last Watchdog
The Last Watchdog
月光博客
月光博客
Latest news
Latest news
MongoDB | Blog
MongoDB | Blog
Apple Machine Learning Research
Apple Machine Learning Research

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
test: guard telegram send mock calls · openclaw/openclaw@abd2ba1
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -539,7 +539,7 @@ describe("sendMessageTelegram", () => {

539539

chat: { id: "123" },

540540

});

541541

await sendMessageTelegram("123", "hi", { ...testCase.opts, cfg: testCase.cfg });

542-

const [token, options] = requireMockCall(botCtorSpy.mock.calls[0], "bot constructor call");

542+

const [token, options] = requireMockCall(botCtorSpy.mock.calls.at(0), "bot constructor call");

543543

expect(token, testCase.name).toBe("tok");

544544

const client = requireRecord(requireRecord(options, "bot options").client, "bot client");

545545

expect(client.timeoutSeconds, testCase.name).toBe(testCase.expectedTimeout);

@@ -563,7 +563,7 @@ describe("sendMessageTelegram", () => {

563563564564

await sendMessageTelegram("123", "hi", { cfg, token: "tok", accountId: "foo" });

565565566-

const [token, options] = requireMockCall(botCtorSpy.mock.calls[0], "bot constructor call");

566+

const [token, options] = requireMockCall(botCtorSpy.mock.calls.at(0), "bot constructor call");

567567

expect(token).toBe("tok");

568568

const client = requireRecord(requireRecord(options, "bot options").client, "bot client");

569569

expect(client.apiRoot).toBe("https://api.telegram.org");

@@ -574,7 +574,7 @@ describe("sendMessageTelegram", () => {

574574575575

await sendMessageTelegram("123", "hi", { cfg: TELEGRAM_TEST_CFG, token: "tok" });

576576577-

const [middleware] = requireMockCall(botConfigUseSpy.mock.calls[0], "bot config use call");

577+

const [middleware] = requireMockCall(botConfigUseSpy.mock.calls.at(0), "bot config use call");

578578

expect(middleware).toBeTypeOf("function");

579579

});

580580

@@ -753,7 +753,7 @@ describe("sendMessageTelegram", () => {

753753

});

754754

try {

755755

await sendMessageTelegram("123", "hi", { cfg: TELEGRAM_TEST_CFG, token: "tok" });

756-

const clientFetch = (botCtorSpy.mock.calls[0]?.[1] as { client?: { fetch?: unknown } })

756+

const clientFetch = (botCtorSpy.mock.calls.at(0)?.[1] as { client?: { fetch?: unknown } })

757757

?.client?.fetch;

758758

expect(clientFetch).toBeTypeOf("function");

759759

expect(clientFetch).not.toBe(fetchSpy);

@@ -855,7 +855,7 @@ describe("sendMessageTelegram", () => {

855855

messageThreadId: 99,

856856

});

857857858-

expectMediaSendCall(sendPhoto.mock.calls[0], "send photo call", chatId, {

858+

expectMediaSendCall(sendPhoto.mock.calls.at(0), "send photo call", chatId, {

859859

caption: "photo in topic",

860860

parse_mode: "HTML",

861861

message_thread_id: 99,

@@ -892,7 +892,7 @@ describe("sendMessageTelegram", () => {

892892

mediaUrl: "https://example.com/photo.jpg",

893893

});

894894895-

expectMediaSendCall(sendPhoto.mock.calls[0], "send photo call", chatId, {

895+

expectMediaSendCall(sendPhoto.mock.calls.at(0), "send photo call", chatId, {

896896

caption: undefined,

897897

});

898898

expect(sendMessage).toHaveBeenCalledWith(chatId, longText, {

@@ -931,7 +931,7 @@ describe("sendMessageTelegram", () => {

931931

mediaUrl: "https://example.com/photo.jpg",

932932

});

933933934-

expectMediaSendCall(sendPhoto.mock.calls[0], "send photo call", chatId, {

934+

expectMediaSendCall(sendPhoto.mock.calls.at(0), "send photo call", chatId, {

935935

caption: undefined,

936936

});

937937

expect(sendMessage).toHaveBeenCalledTimes(2);

@@ -968,7 +968,7 @@ describe("sendMessageTelegram", () => {

968968

mediaUrl: "https://example.com/photo.jpg",

969969

});

970970971-

expectMediaSendCall(sendPhoto.mock.calls[0], "send photo call", chatId, {

971+

expectMediaSendCall(sendPhoto.mock.calls.at(0), "send photo call", chatId, {

972972

caption: shortText,

973973

parse_mode: "HTML",

974974

});

@@ -1001,7 +1001,7 @@ describe("sendMessageTelegram", () => {

10011001

mediaUrl: "https://example.com/photo.jpg",

10021002

});

100310031004-

expectMediaSendCall(sendPhoto.mock.calls[0], "send photo call", chatId, {

1004+

expectMediaSendCall(sendPhoto.mock.calls.at(0), "send photo call", chatId, {

10051005

caption: "hi <b>boss</b>",

10061006

parse_mode: "HTML",

10071007

});

@@ -1039,7 +1039,7 @@ describe("sendMessageTelegram", () => {

10391039

asVideoNote: true,

10401040

});

104110411042-

expectMediaSendCall(sendVideoNote.mock.calls[0], "send video note call", chatId, {});

1042+

expectMediaSendCall(sendVideoNote.mock.calls.at(0), "send video note call", chatId, {});

10431043

expect(sendMessage).toHaveBeenCalledWith(chatId, text, {

10441044

parse_mode: "HTML",

10451045

});

@@ -1070,8 +1070,8 @@ describe("sendMessageTelegram", () => {

10701070

asVideoNote: false,

10711071

});

107210721073-

const [, media, videoParams] = requireMockCall(sendVideo.mock.calls[0], "send video call");

1074-

expect(sendVideo.mock.calls[0]?.[0]).toBe(chatId);

1073+

const [, media, videoParams] = requireMockCall(sendVideo.mock.calls.at(0), "send video call");

1074+

expect(sendVideo.mock.calls.at(0)?.[0]).toBe(chatId);

10751075

if (media === undefined) {

10761076

throw new Error("expected send video media");

10771077

}

@@ -1109,7 +1109,7 @@ describe("sendMessageTelegram", () => {

11091109

});

1110111011111111

expect(probeVideoDimensions).toHaveBeenCalledWith(videoBuffer);

1112-

expectMediaSendCall(sendVideo.mock.calls[0], "send video call", chatId, {

1112+

expectMediaSendCall(sendVideo.mock.calls.at(0), "send video call", chatId, {

11131113

caption: "my caption",

11141114

parse_mode: "HTML",

11151115

width: 720,

@@ -1147,7 +1147,7 @@ describe("sendMessageTelegram", () => {

11471147

});

1148114811491149

expect(probeVideoDimensions).not.toHaveBeenCalled();

1150-

expectMediaSendCall(sendVideoNote.mock.calls[0], "send video note call", chatId, {});

1150+

expectMediaSendCall(sendVideoNote.mock.calls.at(0), "send video note call", chatId, {});

11511151

});

1152115211531153

it("applies reply markup and thread options to split video-note sends", async () => {

@@ -1224,7 +1224,7 @@ describe("sendMessageTelegram", () => {

12241224

await sendMessageTelegram(chatId, testCase.text, sendOptions);

1225122512261226

expectMediaSendCall(

1227-

sendVideoNote.mock.calls[0],

1227+

sendVideoNote.mock.calls.at(0),

12281228

"send video note call",

12291229

chatId,

12301230

testCase.expectedVideoNote,

@@ -1261,7 +1261,7 @@ describe("sendMessageTelegram", () => {

1261126112621262

await vi.runAllTimersAsync();

12631263

await expect(promise).resolves.toEqual({ messageId: "1", chatId });

1264-

expect(setTimeoutSpy.mock.calls[0]?.[1]).toBe(500);

1264+

expect(setTimeoutSpy.mock.calls.at(0)?.[1]).toBe(500);

12651265

setTimeoutSpy.mockRestore();

12661266

vi.useRealTimers();

12671267

});

@@ -1364,7 +1364,7 @@ describe("sendMessageTelegram", () => {

13641364

});

1365136513661366

expect(sendAnimation).toHaveBeenCalledTimes(1);

1367-

expectMediaSendCall(sendAnimation.mock.calls[0], "send animation call", chatId, {

1367+

expectMediaSendCall(sendAnimation.mock.calls.at(0), "send animation call", chatId, {

13681368

caption: "caption",

13691369

parse_mode: "HTML",

13701370

});

@@ -1424,11 +1424,16 @@ describe("sendMessageTelegram", () => {

14241424

forceDocument: true,

14251425

});

142614261427-

expectMediaSendCall(sendDocument.mock.calls[0], `send document call ${testCase.name}`, chatId, {

1428-

caption: "caption",

1429-

parse_mode: "HTML",

1430-

disable_content_type_detection: true,

1431-

});

1427+

expectMediaSendCall(

1428+

sendDocument.mock.calls.at(0),

1429+

`send document call ${testCase.name}`,

1430+

chatId,

1431+

{

1432+

caption: "caption",

1433+

parse_mode: "HTML",

1434+

disable_content_type_detection: true,

1435+

},

1436+

);

14321437

expect(sendPhoto, testCase.name).not.toHaveBeenCalled();

14331438

expect(sendAnimation, testCase.name).not.toHaveBeenCalled();

14341439

expect(sendVideo, testCase.name).not.toHaveBeenCalled();

@@ -1466,7 +1471,7 @@ describe("sendMessageTelegram", () => {

14661471

mediaUrl: "https://example.com/photo.png",

14671472

});

146814731469-

expectMediaSendCall(sendDocument.mock.calls[0], "send document call", chatId, {

1474+

expectMediaSendCall(sendDocument.mock.calls.at(0), "send document call", chatId, {

14701475

caption: "caption",

14711476

parse_mode: "HTML",

14721477

});

@@ -1501,7 +1506,7 @@ describe("sendMessageTelegram", () => {

15011506

mediaUrl: "https://example.com/photo.png",

15021507

});

150315081504-

expectMediaSendCall(sendDocument.mock.calls[0], "send document call", chatId, {

1509+

expectMediaSendCall(sendDocument.mock.calls.at(0), "send document call", chatId, {

15051510

caption: "caption",

15061511

parse_mode: "HTML",

15071512

});

@@ -1532,7 +1537,7 @@ describe("sendMessageTelegram", () => {

15321537

mediaUrl: "https://example.com/report.pdf",

15331538

});

153415391535-

expectMediaSendCall(sendDocument.mock.calls[0], "send document call", chatId, {

1540+

expectMediaSendCall(sendDocument.mock.calls.at(0), "send document call", chatId, {

15361541

caption: "caption",

15371542

parse_mode: "HTML",

15381543

});

@@ -1653,7 +1658,7 @@ describe("sendMessageTelegram", () => {

16531658

const called = testCase.expectedMethod === "sendVoice" ? sendVoice : sendAudio;

16541659

const notCalled = testCase.expectedMethod === "sendVoice" ? sendAudio : sendVoice;

16551660

expectMediaSendCall(

1656-

called.mock.calls[0],

1661+

called.mock.calls.at(0),

16571662

`${testCase.expectedMethod} call ${testCase.name}`,

16581663

testCase.chatId,

16591664

testCase.expectedOptions,

@@ -1926,12 +1931,12 @@ describe("sendMessageTelegram", () => {

19261931

messageThreadId: 271,

19271932

});

192819331929-

expectMediaSendCall(sendPhoto.mock.calls[0], "first send photo call", chatId, {

1934+

expectMediaSendCall(sendPhoto.mock.calls.at(0), "first send photo call", chatId, {

19301935

caption: "photo",

19311936

parse_mode: "HTML",

19321937

message_thread_id: 271,

19331938

});

1934-

expectMediaSendCall(sendPhoto.mock.calls[1], "second send photo call", chatId, {

1939+

expectMediaSendCall(sendPhoto.mock.calls.at(1), "second send photo call", chatId, {

19351940

caption: "photo",

19361941

parse_mode: "HTML",

19371942

});

@@ -1961,7 +1966,10 @@ describe("sendMessageTelegram", () => {

19611966

mediaUrl: "https://example.com/photo.jpg",

19621967

});

196319681964-

const [mediaUrl, options] = requireMockCall(loadWebMedia.mock.calls[0], "load web media call");

1969+

const [mediaUrl, options] = requireMockCall(

1970+

loadWebMedia.mock.calls.at(0),

1971+

"load web media call",

1972+

);

19651973

expect(mediaUrl).toBe("https://example.com/photo.jpg");

19661974

expect(requireRecord(options, "load web media options").maxBytes).toBe(100 * 1024 * 1024);

19671975

});

@@ -1997,7 +2005,10 @@ describe("sendMessageTelegram", () => {

19972005

mediaUrl: "https://example.com/photo.jpg",

19982006

});

199920072000-

const [mediaUrl, options] = requireMockCall(loadWebMedia.mock.calls[0], "load web media call");

2008+

const [mediaUrl, options] = requireMockCall(

2009+

loadWebMedia.mock.calls.at(0),

2010+

"load web media call",

2011+

);

20012012

expect(mediaUrl).toBe("https://example.com/photo.jpg");

20022013

expect(requireRecord(options, "load web media options").maxBytes).toBe(42 * 1024 * 1024);

20032014

});

@@ -2021,8 +2032,8 @@ describe("sendMessageTelegram", () => {

20212032

});

2022203320232034

expect(sendMessage).toHaveBeenCalledTimes(2);

2024-

const firstCall = requireMockCall(sendMessage.mock.calls[0], "first sendMessage call");

2025-

const secondCall = requireMockCall(sendMessage.mock.calls[1], "second sendMessage call");

2035+

const firstCall = requireMockCall(sendMessage.mock.calls.at(0), "first sendMessage call");

2036+

const secondCall = requireMockCall(sendMessage.mock.calls.at(1), "second sendMessage call");

20262037

expect((firstCall[1] as string).length).toBeLessThanOrEqual(4000);

20272038

expect((secondCall[1] as string).length).toBeLessThanOrEqual(4000);

20282039

expect(firstCall[2]?.reply_markup).toBeUndefined();

@@ -2050,8 +2061,8 @@ describe("sendMessageTelegram", () => {

20502061

});

2051206220522063

expect(sendMessage).toHaveBeenCalledTimes(2);

2053-

const firstCall = requireMockCall(sendMessage.mock.calls[0], "first sendMessage call");

2054-

const secondCall = requireMockCall(sendMessage.mock.calls[1], "second sendMessage call");

2064+

const firstCall = requireMockCall(sendMessage.mock.calls.at(0), "first sendMessage call");

2065+

const secondCall = requireMockCall(sendMessage.mock.calls.at(1), "second sendMessage call");

20552066

expect(String(firstCall[1] ?? "").length).toBeLessThanOrEqual(4000);

20562067

expect(String(secondCall[1] ?? "").length).toBeLessThanOrEqual(4000);

20572068

expect(firstCall[2]?.parse_mode).toBe("HTML");

@@ -2089,7 +2100,7 @@ describe("sendMessageTelegram", () => {

20892100

});

2090210120912102

expect(sendMessage).toHaveBeenCalledTimes(4);

2092-

const plainFallbackCalls = [sendMessage.mock.calls[1], sendMessage.mock.calls[3]];

2103+

const plainFallbackCalls = [sendMessage.mock.calls.at(1), sendMessage.mock.calls.at(3)];

20932104

expect(plainFallbackCalls.map((call) => String(call?.[1] ?? "")).join("")).toBe(plainText);

20942105

expect(plainFallbackCalls.some((call) => String(call?.[1] ?? "").includes("<"))).toBe(false);

20952106

expect(res.messageId).toBe("91");

@@ -2119,8 +2130,8 @@ describe("sendMessageTelegram", () => {

21192130

});

2120213121212132

expect(sendMessage).toHaveBeenCalledTimes(4);

2122-

expect(String(sendMessage.mock.calls[0]?.[1] ?? "")).toMatch(/^&/);

2123-

const plainFallbackCalls = [sendMessage.mock.calls[1], sendMessage.mock.calls[3]];

2133+

expect(String(sendMessage.mock.calls.at(0)?.[1] ?? "")).toMatch(/^&/);

2134+

const plainFallbackCalls = [sendMessage.mock.calls.at(1), sendMessage.mock.calls.at(3)];

21242135

expect(plainFallbackCalls.map((call) => String(call?.[1] ?? "")).join("")).toBe(plainText);

21252136

expect(plainFallbackCalls.every((call) => String(call?.[1] ?? "").length > 0)).toBe(true);

21262137

expect(res.messageId).toBe("93");

@@ -2397,7 +2408,7 @@ describe("sendStickerTelegram", () => {

2397240823982409

await vi.runAllTimersAsync();

23992410

await expect(promise).resolves.toEqual({ messageId: "109", chatId });

2400-

expect(setTimeoutSpy.mock.calls[0]?.[1]).toBe(1000);

2411+

expect(setTimeoutSpy.mock.calls.at(0)?.[1]).toBe(1000);

24012412

expect(sendSticker).toHaveBeenCalledTimes(2);

24022413

setTimeoutSpy.mockRestore();

24032414

vi.useRealTimers();

@@ -2658,11 +2669,11 @@ describe("editMessageTelegram", () => {

26582669

});

2659267026602671

expect(botCtorSpy, testCase.name).toHaveBeenCalledTimes(1);

2661-

expect(botCtorSpy.mock.calls[0]?.[0], testCase.name).toBe("tok");

2672+

expect(botCtorSpy.mock.calls.at(0)?.[0], testCase.name).toBe("tok");

26622673

expect(botApi.editMessageText, testCase.name).toHaveBeenCalledTimes(testCase.expectedCalls);

2663267426642675

const firstParams = requireRecord(

2665-

(botApi.editMessageText.mock.calls[0] ?? [])[3],

2676+

(botApi.editMessageText.mock.calls.at(0) ?? [])[3],

26662677

"first edit params",

26672678

);

26682679

expect(firstParams.parse_mode, testCase.name).toBe("HTML");

@@ -2675,7 +2686,7 @@ describe("editMessageTelegram", () => {

2675268626762687

if ("secondExpectReplyMarkup" in testCase && testCase.secondExpectReplyMarkup) {

26772688

const secondParams = requireRecord(

2678-

(botApi.editMessageText.mock.calls[1] ?? [])[3],

2689+

(botApi.editMessageText.mock.calls.at(1) ?? [])[3],

26792690

"second edit params",

26802691

);

26812692

expect(secondParams.reply_markup, testCase.name).toEqual(testCase.secondExpectReplyMarkup);

@@ -2724,7 +2735,7 @@ describe("editMessageTelegram", () => {

27242735

});

2725273627262737

expect(botApi.editMessageText).toHaveBeenCalledTimes(1);

2727-

const params = requireRecord((botApi.editMessageText.mock.calls[0] ?? [])[3], "edit params");

2738+

const params = requireRecord((botApi.editMessageText.mock.calls.at(0) ?? [])[3], "edit params");

27282739

expect(params.parse_mode).toBe("HTML");

27292740

expect(params.link_preview_options).toEqual({ is_disabled: true });

27302741

});

@@ -2770,10 +2781,12 @@ describe("sendPollTelegram", () => {

27702781

expect(res).toEqual({ messageId: "123", chatId: "555", pollId: "p1" });

27712782

expect(api.sendPoll).toHaveBeenCalledTimes(1);

27722783

const sendPollMock = api.sendPoll as ReturnType<typeof vi.fn>;

2773-

expect(sendPollMock.mock.calls[0]?.[0]).toBe("123");

2774-

expect(sendPollMock.mock.calls[0]?.[1]).toBe("Q");

2775-

expect(sendPollMock.mock.calls[0]?.[2]).toEqual(["A", "B"]);

2776-

expect(requireRecord(sendPollMock.mock.calls[0]?.[3], "send poll params").open_period).toBe(60);

2784+

expect(sendPollMock.mock.calls.at(0)?.[0]).toBe("123");

2785+

expect(sendPollMock.mock.calls.at(0)?.[1]).toBe("Q");

2786+

expect(sendPollMock.mock.calls.at(0)?.[2]).toEqual(["A", "B"]);

2787+

expect(requireRecord(sendPollMock.mock.calls.at(0)?.[3], "send poll params").open_period).toBe(

2788+

60,

2789+

);

27772790

});

2778279127792792

it("retries without message_thread_id on thread-not-found", async () => {

@@ -2803,10 +2816,10 @@ describe("sendPollTelegram", () => {

28032816

expect(res).toEqual({ messageId: "1", chatId: "2", pollId: "p2" });

28042817

expect(api.sendPoll).toHaveBeenCalledTimes(2);

28052818

expect(

2806-

requireRecord(api.sendPoll.mock.calls[0]?.[3], "send poll params").message_thread_id,

2819+

requireRecord(api.sendPoll.mock.calls.at(0)?.[3], "send poll params").message_thread_id,

28072820

).toBe(99);

28082821

expect(

2809-

(api.sendPoll.mock.calls[1]?.[3] as { message_thread_id?: unknown } | undefined)

2822+

(api.sendPoll.mock.calls.at(1)?.[3] as { message_thread_id?: unknown } | undefined)

28102823

?.message_thread_id,

28112824

).toBeUndefined();

28122825

});