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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
小众软件
小众软件
F
Fortinet All Blogs
博客园 - 叶小钗
博客园_首页
D
DataBreaches.Net
Apple Machine Learning Research
Apple Machine Learning Research
U
Unit 42
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
博客园 - Franky
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
IT之家
IT之家
M
MIT News - Artificial intelligence
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - 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
refactor(infra): drop unused web push id helpers · opencl...
vincentkoc · 2026-06-19 · via Recent Commits to openclaw:main

@@ -6,17 +6,13 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

66

import webPush from "web-push";

77

import {

88

broadcastWebPush,

9-

clearWebPushSubscription,

109

clearWebPushSubscriptionByEndpoint,

1110

listWebPushSubscriptions,

12-

loadWebPushSubscription,

1311

registerWebPushSubscription,

1412

resolveVapidKeys,

1513

sendWebPushNotification,

1614

} from "./push-web.js";

171518-

type WebPushSubscription = NonNullable<Awaited<ReturnType<typeof loadWebPushSubscription>>>;

19-2016

// Stub resolveStateDir so tests use a temp directory.

2117

let tmpDir: string;

2218

vi.mock("../config/paths.js", () => ({

@@ -35,16 +31,6 @@ vi.mock("web-push", () => ({

3531

},

3632

}));

373338-

function expectLoadedSubscription(

39-

loaded: Awaited<ReturnType<typeof loadWebPushSubscription>>,

40-

): WebPushSubscription {

41-

if (loaded === null) {

42-

throw new Error("Expected loaded web push subscription");

43-

}

44-

expect(loaded.endpoint).not.toBe("");

45-

return loaded;

46-

}

47-4834

beforeEach(async () => {

4935

tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "push-web-test-"));

5036

vi.clearAllMocks();

@@ -128,21 +114,6 @@ describe("subscription CRUD", () => {

128114

expect(sub2.keys.p256dh).toBe("new-p256dh");

129115

});

130116131-

it("loads a subscription by ID", async () => {

132-

const sub = await registerWebPushSubscription({

133-

endpoint,

134-

keys,

135-

baseDir: tmpDir,

136-

});

137-

const loaded = await loadWebPushSubscription(sub.subscriptionId, tmpDir);

138-

expect(expectLoadedSubscription(loaded).endpoint).toBe(endpoint);

139-

});

140-141-

it("returns null for unknown subscription ID", async () => {

142-

const loaded = await loadWebPushSubscription("nonexistent", tmpDir);

143-

expect(loaded).toBeNull();

144-

});

145-146117

it("lists all subscriptions", async () => {

147118

await registerWebPushSubscription({

148119

endpoint: "https://push.example.com/a",

@@ -158,19 +129,6 @@ describe("subscription CRUD", () => {

158129

expect(list).toHaveLength(2);

159130

});

160131161-

it("clears a subscription by ID", async () => {

162-

const sub = await registerWebPushSubscription({

163-

endpoint,

164-

keys,

165-

baseDir: tmpDir,

166-

});

167-

const removed = await clearWebPushSubscription(sub.subscriptionId, tmpDir);

168-

expect(removed).toBe(true);

169-170-

const list = await listWebPushSubscriptions(tmpDir);

171-

expect(list).toHaveLength(0);

172-

});

173-174132

it("clears a subscription by endpoint", async () => {

175133

await registerWebPushSubscription({ endpoint, keys, baseDir: tmpDir });

176134

const removed = await clearWebPushSubscriptionByEndpoint(endpoint, tmpDir);