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

推荐订阅源

Jina AI
Jina AI
MyScale Blog
MyScale Blog
量子位
月光博客
月光博客
J
Java Code Geeks
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
U
Unit 42
WordPress大学
WordPress大学
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
腾讯CDC
G
Google Developers Blog
博客园 - 【当耐特】
Engineering at Meta
Engineering at Meta
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
IT之家
IT之家
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
B
Blog
Martin Fowler
Martin Fowler
P
Proofpoint News Feed
B
Blog RSS Feed

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: guard node invoke wake mock calls · openclaw/opencl...
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -380,22 +380,22 @@ describe("node.pair.request", () => {

380380

permissions: { camera: true },

381381

}),

382382

);

383-

expect(broadcast.mock.calls[0]?.[0]).toBe("node.pair.resolved");

384-

expect(broadcast.mock.calls[0]?.[1]).toEqual({

383+

expect(broadcast.mock.calls.at(0)?.[0]).toBe("node.pair.resolved");

384+

expect(broadcast.mock.calls.at(0)?.[1]).toEqual({

385385

requestId: "req-old",

386386

nodeId: "ios-node-1",

387387

decision: "rejected",

388388

ts: expect.any(Number),

389389

});

390-

expect(broadcast.mock.calls[1]?.[0]).toBe("node.pair.requested");

391-

expect(broadcast.mock.calls[1]?.[1]).toEqual(

390+

expect(broadcast.mock.calls.at(1)?.[0]).toBe("node.pair.requested");

391+

expect(broadcast.mock.calls.at(1)?.[1]).toEqual(

392392

expect.objectContaining({

393393

requestId: "req-new",

394394

nodeId: "ios-node-1",

395395

permissions: { camera: true },

396396

}),

397397

);

398-

expect(respond.mock.calls[0]?.[0]).toBe(true);

398+

expect(respond.mock.calls.at(0)?.[0]).toBe(true);

399399

});

400400

});

401401

@@ -426,7 +426,7 @@ describe("node plugin surface refresh", () => {

426426

});

427427428428

expect(respond).toHaveBeenCalledTimes(1);

429-

const call = respond.mock.calls[0] as RespondCall | undefined;

429+

const call = respond.mock.calls.at(0) as RespondCall | undefined;

430430

expect(call?.[0]).toBe(true);

431431

expect(call?.[2]).toBeUndefined();

432432

const payload = requireRecord(call?.[1], "refresh payload");

@@ -482,7 +482,7 @@ describe("node.invoke APNs wake path", () => {

482482

};

483483484484

const respond = await invokeNode({ nodeRegistry });

485-

const call = respond.mock.calls[0] as RespondCall | undefined;

485+

const call = respond.mock.calls.at(0) as RespondCall | undefined;

486486

expect(call?.[0]).toBe(false);

487487

expect(call?.[2]?.code).toBe(ErrorCodes.UNAVAILABLE);

488488

expect(call?.[2]?.message).toBe("node not connected");

@@ -591,11 +591,11 @@ describe("node.invoke APNs wake path", () => {

591591592592

expect(mocks.sendApnsBackgroundWake).toHaveBeenCalledTimes(1);

593593

expect(nodeRegistry.invoke).toHaveBeenCalledTimes(1);

594-

expectRecordFields(nodeRegistry.invoke.mock.calls[0]?.[0], "node invoke payload", {

594+

expectRecordFields(nodeRegistry.invoke.mock.calls.at(0)?.[0], "node invoke payload", {

595595

nodeId: "ios-node-reconnect",

596596

command: "camera.capture",

597597

});

598-

const call = respond.mock.calls[0] as RespondCall | undefined;

598+

const call = respond.mock.calls.at(0) as RespondCall | undefined;

599599

expect(call?.[0]).toBe(true);

600600

expectRecordFields(call?.[1], "respond payload", { ok: true, nodeId: "ios-node-reconnect" });

601601

});

@@ -635,12 +635,16 @@ describe("node.invoke APNs wake path", () => {

635635

isWebchatConnect: () => false,

636636

});

637637638-

expect(respond.mock.calls[0]?.[0]).toBe(true);

639-

expect(broadcast.mock.calls[0]?.[0]).toBe("talk.event");

640-

const broadcastPayload = expectRecordFields(broadcast.mock.calls[0]?.[1], "broadcast payload", {

641-

nodeId: "android-talk-node",

642-

command: "talk.ptt.start",

643-

});

638+

expect(respond.mock.calls.at(0)?.[0]).toBe(true);

639+

expect(broadcast.mock.calls.at(0)?.[0]).toBe("talk.event");

640+

const broadcastPayload = expectRecordFields(

641+

broadcast.mock.calls.at(0)?.[1],

642+

"broadcast payload",

643+

{

644+

nodeId: "android-talk-node",

645+

command: "talk.ptt.start",

646+

},

647+

);

644648

const talkEvent = expectRecordFields(broadcastPayload.talkEvent, "talk event", {

645649

type: "capture.started",

646650

sessionId: "node:android-talk-node:talk:capture-1",

@@ -655,7 +659,7 @@ describe("node.invoke APNs wake path", () => {

655659

nodeId: "android-talk-node",

656660

command: "talk.ptt.start",

657661

});

658-

expect(broadcast.mock.calls[0]?.[2]).toEqual({ dropIfSlow: true });

662+

expect(broadcast.mock.calls.at(0)?.[2]).toEqual({ dropIfSlow: true });

659663

});

660664661665

it("clears stale registrations after an invalid device token wake failure", async () => {

@@ -768,14 +772,14 @@ describe("node.invoke APNs wake path", () => {

768772

idempotencyKey: "idem-queued",

769773

},

770774

});

771-

const call = respond.mock.calls[0] as RespondCall | undefined;

775+

const call = respond.mock.calls.at(0) as RespondCall | undefined;

772776

expect(call?.[0]).toBe(false);

773777

expect(call?.[2]?.code).toBe(ErrorCodes.UNAVAILABLE);

774778

expect(call?.[2]?.message).toBe("node command queued until iOS returns to foreground");

775779

expect(mocks.sendApnsBackgroundWake).not.toHaveBeenCalled();

776780777781

const pullRespond = await pullPending("ios-node-queued", ["canvas.navigate"]);

778-

const pullCall = pullRespond.mock.calls[0] as RespondCall | undefined;

782+

const pullCall = pullRespond.mock.calls.at(0) as RespondCall | undefined;

779783

const pullPayload = requireRespondPayload(pullCall, "pull response");

780784

expectRecordFields(pullPayload, "pull payload", {

781785

nodeId: "ios-node-queued",

@@ -786,7 +790,7 @@ describe("node.invoke APNs wake path", () => {

786790

});

787791788792

const repeatedPullRespond = await pullPending("ios-node-queued", ["canvas.navigate"]);

789-

const repeatedPullCall = repeatedPullRespond.mock.calls[0] as RespondCall | undefined;

793+

const repeatedPullCall = repeatedPullRespond.mock.calls.at(0) as RespondCall | undefined;

790794

const repeatedPullPayload = requireRespondPayload(repeatedPullCall, "repeated pull response");

791795

expectRecordFields(repeatedPullPayload, "repeated pull payload", {

792796

nodeId: "ios-node-queued",

@@ -803,15 +807,15 @@ describe("node.invoke APNs wake path", () => {

803807

expect(isUuidV4(queuedActionId)).toBe(true);

804808805809

const ackRespond = await ackPending("ios-node-queued", [queuedActionId], ["canvas.navigate"]);

806-

const ackCall = ackRespond.mock.calls[0] as RespondCall | undefined;

810+

const ackCall = ackRespond.mock.calls.at(0) as RespondCall | undefined;

807811

expectRecordFields(requireRespondPayload(ackCall, "ack response"), "ack payload", {

808812

nodeId: "ios-node-queued",

809813

ackedIds: [queuedActionId],

810814

remainingCount: 0,

811815

});

812816813817

const emptyPullRespond = await pullPending("ios-node-queued", ["canvas.navigate"]);

814-

const emptyPullCall = emptyPullRespond.mock.calls[0] as RespondCall | undefined;

818+

const emptyPullCall = emptyPullRespond.mock.calls.at(0) as RespondCall | undefined;

815819

expectRecordFields(

816820

requireRespondPayload(emptyPullCall, "empty pull response"),

817821

"empty pull payload",

@@ -867,7 +871,7 @@ describe("node.invoke APNs wake path", () => {

867871

"camera.snap",

868872

"canvas.navigate",

869873

]);

870-

const preChangePullCall = preChangePullRespond.mock.calls[0] as RespondCall | undefined;

874+

const preChangePullCall = preChangePullRespond.mock.calls.at(0) as RespondCall | undefined;

871875

const preChangePayload = requireRespondPayload(preChangePullCall, "pre-change pull response");

872876

expectRecordFields(preChangePayload, "pre-change pull payload", {

873877

nodeId: "ios-node-policy",

@@ -880,7 +884,7 @@ describe("node.invoke APNs wake path", () => {

880884

allowlistedCommands.delete("camera.snap");

881885882886

const pullRespond = await pullPending("ios-node-policy", ["camera.snap", "canvas.navigate"]);

883-

const pullCall = pullRespond.mock.calls[0] as RespondCall | undefined;

887+

const pullCall = pullRespond.mock.calls.at(0) as RespondCall | undefined;

884888

expectRecordFields(requireRespondPayload(pullCall, "pull response"), "pull payload", {

885889

nodeId: "ios-node-policy",

886890

actions: [],

@@ -925,7 +929,7 @@ describe("node.invoke APNs wake path", () => {

925929

});

926930927931

const pullRespond = await pullPending("ios-node-dedupe", ["canvas.navigate"]);

928-

const pullCall = pullRespond.mock.calls[0] as RespondCall | undefined;

932+

const pullCall = pullRespond.mock.calls.at(0) as RespondCall | undefined;

929933

const pullPayload = requireRespondPayload(pullCall, "pull response");

930934

expectRecordFields(pullPayload, "pull payload", {

931935

nodeId: "ios-node-dedupe",