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

推荐订阅源

WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
Vercel News
Vercel News
U
Unit 42
L
LangChain Blog
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare Blog
F
Fortinet All Blogs
小众软件
小众软件
I
InfoQ
P
Proofpoint News Feed
D
DataBreaches.Net
Martin Fowler
Martin Fowler
H
Help Net Security
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog

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
perf: reduce latency across async I/O hot paths · opencla...
ynachiket · 2026-05-29 · via Recent Commits to openclaw:main

@@ -2,6 +2,7 @@ import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";

2233

const listDevicePairingMock = vi.fn();

44

const loadApnsRegistrationMock = vi.fn();

5+

const loadApnsRegistrationsMock = vi.fn();

56

const resolveApnsAuthConfigFromEnvMock = vi.fn();

67

const resolveApnsRelayConfigFromEnvMock = vi.fn();

78

const sendApnsExecApprovalAlertMock = vi.fn();

@@ -68,6 +69,7 @@ vi.mock("../infra/device-pairing.js", async () => {

68696970

vi.mock("../infra/push-apns.js", () => ({

7071

loadApnsRegistration: loadApnsRegistrationMock,

72+

loadApnsRegistrations: loadApnsRegistrationsMock,

7173

resolveApnsAuthConfigFromEnv: resolveApnsAuthConfigFromEnvMock,

7274

resolveApnsRelayConfigFromEnv: resolveApnsRelayConfigFromEnvMock,

7375

sendApnsExecApprovalAlert: sendApnsExecApprovalAlertMock,

@@ -92,6 +94,16 @@ describe("createExecApprovalIosPushDelivery", () => {

9294

environment: "sandbox",

9395

updatedAtMs: 1,

9496

});

97+

loadApnsRegistrationsMock.mockImplementation(async (nodeIds: readonly string[]) => {

98+

const registrations = [];

99+

for (const nodeId of nodeIds) {

100+

const registration = await loadApnsRegistrationMock(nodeId);

101+

if (registration) {

102+

registrations.push({ nodeId, registration });

103+

}

104+

}

105+

return registrations;

106+

});

95107

resolveApnsAuthConfigFromEnvMock.mockResolvedValue({

96108

ok: true,

97109

value: { teamId: "team", keyId: "key", privateKey: "private-key" },

@@ -150,7 +162,7 @@ describe("createExecApprovalIosPushDelivery", () => {

150162

});

151163152164

expect(accepted).toBe(false);

153-

expect(loadApnsRegistrationMock).not.toHaveBeenCalled();

165+

expect(loadApnsRegistrationsMock).not.toHaveBeenCalled();

154166

expect(sendApnsExecApprovalAlertMock).not.toHaveBeenCalled();

155167

});

156168

@@ -167,10 +179,64 @@ describe("createExecApprovalIosPushDelivery", () => {

167179

});

168180169181

expect(accepted).toBe(true);

170-

expect(loadApnsRegistrationMock).toHaveBeenCalledWith("ios-device-1");

182+

expect(loadApnsRegistrationsMock).toHaveBeenCalledWith(["ios-device-1"]);

171183

expect(sendApnsExecApprovalAlertMock).toHaveBeenCalledTimes(1);

172184

});

173185186+

it("loads APNs registrations in one bulk read for all visible iOS operators", async () => {

187+

listDevicePairingMock.mockResolvedValue({

188+

pending: [],

189+

paired: [

190+

{

191+

deviceId: "ios-device-1",

192+

publicKey: "pub-1",

193+

platform: "iOS 18",

194+

role: "operator",

195+

roles: ["operator"],

196+

createdAtMs: 1,

197+

approvedAtMs: 1,

198+

tokens: {

199+

operator: {

200+

token: "operator-token-1",

201+

role: "operator",

202+

scopes: ["operator.approvals"],

203+

createdAtMs: 1,

204+

},

205+

},

206+

},

207+

{

208+

deviceId: "ios-device-2",

209+

publicKey: "pub-2",

210+

platform: "iPadOS 18",

211+

role: "operator",

212+

roles: ["operator"],

213+

createdAtMs: 1,

214+

approvedAtMs: 2,

215+

tokens: {

216+

operator: {

217+

token: "operator-token-2",

218+

role: "operator",

219+

scopes: ["operator.approvals"],

220+

createdAtMs: 1,

221+

},

222+

},

223+

},

224+

],

225+

});

226+227+

const delivery = createExecApprovalIosPushDelivery({ log: {} });

228+229+

await delivery.handleRequested({

230+

id: "approval-bulk-load",

231+

request: { command: "echo ok", host: "gateway", allowedDecisions: ["allow-once"] },

232+

createdAtMs: 1,

233+

expiresAtMs: 2,

234+

});

235+236+

expect(loadApnsRegistrationsMock).toHaveBeenCalledTimes(1);

237+

expect(loadApnsRegistrationsMock).toHaveBeenCalledWith(["ios-device-1", "ios-device-2"]);

238+

});

239+174240

it("does not target iOS devices rejected by the approval visibility filter", async () => {

175241

mockPairedIosOperator(["operator.approvals", "operator.read"]);

176242

const isTargetVisible = vi.fn(() => false);

@@ -192,7 +258,7 @@ describe("createExecApprovalIosPushDelivery", () => {

192258

deviceId: "ios-device-1",

193259

scopes: ["operator.approvals", "operator.read"],

194260

});

195-

expect(loadApnsRegistrationMock).not.toHaveBeenCalled();

261+

expect(loadApnsRegistrationsMock).not.toHaveBeenCalled();

196262

expect(sendApnsExecApprovalAlertMock).not.toHaveBeenCalled();

197263

});

198264

@@ -285,7 +351,7 @@ describe("createExecApprovalIosPushDelivery", () => {

285351

"exec approvals: iOS cleanup push skipped approvalId=approval-missing-targets reason=missing-targets",

286352

);

287353

expect(listDevicePairingMock).not.toHaveBeenCalled();

288-

expect(loadApnsRegistrationMock).not.toHaveBeenCalled();

354+

expect(loadApnsRegistrationsMock).not.toHaveBeenCalled();

289355

expect(sendApnsExecApprovalResolvedWakeMock).not.toHaveBeenCalled();

290356

});

291357

@@ -321,7 +387,7 @@ describe("createExecApprovalIosPushDelivery", () => {

321387

});

322388323389

expect(listDevicePairingMock).not.toHaveBeenCalled();

324-

expect(loadApnsRegistrationMock).toHaveBeenCalledWith("ios-device-1");

390+

expect(loadApnsRegistrationsMock).toHaveBeenCalledWith(["ios-device-1"]);

325391

expect(sendApnsExecApprovalResolvedWakeMock).toHaveBeenCalledTimes(1);

326392

});

327393

});