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

推荐订阅源

博客园 - 叶小钗
爱范儿
爱范儿
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
博客园 - 聂微东
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
罗磊的独立博客
Jina AI
Jina AI

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
fix(qa-matrix): detect sqlite dedupe commits by payload ·...
steipete · 2026-06-01 · via Recent Commits to openclaw:main

@@ -217,38 +217,67 @@ async function hasPersistedMatrixPluginStateDedupeEntry(params: {

217217

eventId: string;

218218

roomId: string;

219219

stateDir: string;

220-

}) {

221-

const databasePath = path.join(params.stateDir, "state", "openclaw.sqlite");

220+

}): Promise<string | null> {

222221

const entryKey = buildMatrixInboundDedupePluginStateKey({

223222

accountId: params.accountId,

224223

eventId: params.eventId,

225224

roomId: params.roomId,

226225

});

226+

const databasePaths = await findFilesByName({

227+

filename: "openclaw.sqlite",

228+

rootDir: params.stateDir,

229+

maxDepth: 4,

230+

});

231+

if (databasePaths.length === 0) {

232+

databasePaths.push(path.join(params.stateDir, "state", "openclaw.sqlite"));

233+

}

234+

const now = Date.now();

235+

const isExpectedValue = (raw: unknown) => {

236+

if (typeof raw !== "string") {

237+

return false;

238+

}

239+

try {

240+

const parsed = JSON.parse(raw) as unknown;

241+

return (

242+

isRecord(parsed) && parsed.roomId === params.roomId && parsed.eventId === params.eventId

243+

);

244+

} catch {

245+

return false;

246+

}

247+

};

227248

try {

228-

await fs.access(databasePath);

229249

const sqlite = await import("node:sqlite");

230-

const db = new sqlite.DatabaseSync(databasePath, { readOnly: true });

231-

try {

232-

const row = db

233-

.prepare(

234-

`SELECT 1 AS ok

235-

FROM plugin_state_entries

236-

WHERE plugin_id = ?

237-

AND namespace = ?

238-

AND entry_key = ?

239-

AND (expires_at IS NULL OR expires_at > ?)

240-

LIMIT 1`,

241-

)

242-

.get(MATRIX_PLUGIN_ID, MATRIX_INBOUND_DEDUPE_NAMESPACE, entryKey, Date.now()) as

243-

| { ok?: unknown }

244-

| undefined;

245-

return row?.ok === 1;

246-

} finally {

247-

db.close();

250+

for (const databasePath of databasePaths) {

251+

try {

252+

await fs.access(databasePath);

253+

const db = new sqlite.DatabaseSync(databasePath, { readOnly: true });

254+

try {

255+

const rows = db

256+

.prepare(

257+

`SELECT entry_key AS entryKey, value_json AS valueJson

258+

FROM plugin_state_entries

259+

WHERE plugin_id = ?

260+

AND namespace = ?

261+

AND (expires_at IS NULL OR expires_at > ?)`,

262+

)

263+

.all(MATRIX_PLUGIN_ID, MATRIX_INBOUND_DEDUPE_NAMESPACE, now) as Array<{

264+

entryKey?: unknown;

265+

valueJson?: unknown;

266+

}>;

267+

if (rows.some((row) => row.entryKey === entryKey || isExpectedValue(row.valueJson))) {

268+

return databasePath;

269+

}

270+

} finally {

271+

db.close();

272+

}

273+

} catch {

274+

continue;

275+

}

248276

}

249277

} catch {

250-

return false;

278+

return null;

251279

}

280+

return null;

252281

}

253282254283

export async function waitForMatrixInboundDedupeEntry(params: {

@@ -260,15 +289,14 @@ export async function waitForMatrixInboundDedupeEntry(params: {

260289

}) {

261290

const startedAt = Date.now();

262291

while (Date.now() - startedAt < params.timeoutMs) {

263-

if (

264-

await hasPersistedMatrixPluginStateDedupeEntry({

265-

accountId: params.context.sutAccountId ?? "sut",

266-

eventId: params.eventId,

267-

roomId: params.roomId,

268-

stateDir: params.stateDir,

269-

})

270-

) {

271-

return path.join(params.stateDir, "state", "openclaw.sqlite");

292+

const sqlitePath = await hasPersistedMatrixPluginStateDedupeEntry({

293+

accountId: params.context.sutAccountId ?? "sut",

294+

eventId: params.eventId,

295+

roomId: params.roomId,

296+

stateDir: params.stateDir,

297+

});

298+

if (sqlitePath) {

299+

return sqlitePath;

272300

}

273301

const pathname = await resolveBestMatrixStateFile({

274302

context: params.context,