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

推荐订阅源

爱范儿
爱范儿
腾讯CDC
博客园 - 司徒正美
A
About on SuperTechFans
H
Help Net Security
J
Java Code Geeks
C
Check Point Blog
B
Blog RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
MongoDB | Blog
MongoDB | Blog
U
Unit 42
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
MyScale Blog
MyScale Blog
V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
H
Hackread – Cybersecurity News, Data Breaches, AI and More
F
Fortinet All Blogs
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
博客园 - 【当耐特】
雷峰网
雷峰网

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: assert matrix sync store payloads · openclaw/opencl...
shakkernerd · 2026-05-11 · via Recent Commits to openclaw:main

@@ -81,33 +81,52 @@ describe("FileBackedMatrixSyncStore", () => {

81818282

it("persists sync data so restart resumes from the saved cursor", async () => {

8383

const storagePath = createStoragePath();

84+

const syncResponse = createSyncResponse("s123");

84858586

const firstStore = new FileBackedMatrixSyncStore(storagePath);

8687

expect(firstStore.hasSavedSync()).toBe(false);

87-

await firstStore.setSyncData(createSyncResponse("s123"));

88+

await firstStore.setSyncData(syncResponse);

8889

await firstStore.flush();

89909091

const secondStore = new FileBackedMatrixSyncStore(storagePath);

9192

expect(secondStore.hasSavedSync()).toBe(true);

9293

await expect(secondStore.getSavedSyncToken()).resolves.toBe("s123");

93949495

const savedSync = await secondStore.getSavedSync();

95-

expect(savedSync?.nextBatch).toBe("s123");

96-

expect(savedSync?.accountData).toEqual([

97-

{

98-

content: { theme: "dark" },

99-

type: "com.openclaw.test",

100-

},

101-

]);

102-

expect(savedSync?.roomsData.join?.["!room:example.org"]).toMatchObject({

103-

timeline: {

104-

events: [

105-

{

106-

event_id: "$message",

107-

sender: "@user:example.org",

108-

type: "m.room.message",

96+

expect(savedSync).toEqual({

97+

nextBatch: "s123",

98+

accountData: syncResponse.account_data.events,

99+

roomsData: {

100+

join: {

101+

"!room:example.org": {

102+

summary: {

103+

"m.heroes": [],

104+

},

105+

state: { events: [] },

106+

"org.matrix.msc4222.state_after": { events: [] },

107+

timeline: {

108+

events: [

109+

{

110+

content: {

111+

body: "hello",

112+

msgtype: "m.text",

113+

},

114+

event_id: "$message",

115+

origin_server_ts: 1,

116+

sender: "@user:example.org",

117+

type: "m.room.message",

118+

},

119+

],

120+

prev_batch: "t0",

121+

},

122+

ephemeral: { events: [] },

123+

account_data: { events: [] },

124+

unread_notifications: {},

109125

},

110-

],

126+

},

127+

invite: {},

128+

leave: {},

129+

knock: {},

111130

},

112131

});

113132

expect(secondStore.hasSavedSyncFromCleanShutdown()).toBe(false);

@@ -195,17 +214,66 @@ describe("FileBackedMatrixSyncStore", () => {

195214

await vi.advanceTimersByTimeAsync(1);

196215

await Promise.resolve();

197216

expect(writeSpy).toHaveBeenCalledTimes(1);

198-

expect(writeSpy).toHaveBeenCalledWith(

217+

expect(writeSpy.mock.calls[0]).toEqual([

199218

storagePath,

200-

expect.objectContaining({

201-

savedSync: expect.objectContaining({

219+

{

220+

version: 1,

221+

savedSync: {

202222

nextBatch: "s222",

203-

}),

223+

accountData: createSyncResponse("s222").account_data.events,

224+

roomsData: {

225+

join: {

226+

"!room:example.org": {

227+

summary: {

228+

"m.heroes": [],

229+

"m.invited_member_count": undefined,

230+

"m.joined_member_count": undefined,

231+

},

232+

state: { events: [] },

233+

"org.matrix.msc4222.state_after": { events: [] },

234+

timeline: {

235+

events: [

236+

{

237+

content: {

238+

body: "hello",

239+

msgtype: "m.text",

240+

},

241+

event_id: "$message",

242+

origin_server_ts: 1,

243+

sender: "@user:example.org",

244+

type: "m.room.message",

245+

},

246+

{

247+

content: {

248+

body: "hello",

249+

msgtype: "m.text",

250+

},

251+

event_id: "$message",

252+

origin_server_ts: 1,

253+

sender: "@user:example.org",

254+

type: "m.room.message",

255+

},

256+

],

257+

prev_batch: "t0",

258+

},

259+

ephemeral: { events: [] },

260+

account_data: { events: [] },

261+

unread_notifications: {},

262+

unread_thread_notifications: undefined,

263+

msc4354_sticky: undefined,

264+

},

265+

},

266+

invite: {},

267+

leave: {},

268+

knock: {},

269+

},

270+

},

271+

cleanShutdown: false,

204272

clientOptions: {

205273

lazyLoadMembers: true,

206274

},

207-

}),

208-

);

275+

},

276+

]);

209277210278

await store.flush();

211279

});

@@ -267,10 +335,13 @@ describe("FileBackedMatrixSyncStore", () => {

267335

const store = new FileBackedMatrixSyncStore(storagePath);

268336

expect(store.hasSavedSync()).toBe(true);

269337

await expect(store.getSavedSyncToken()).resolves.toBe("legacy-token");

270-

await expect(store.getSavedSync()).resolves.toMatchObject({

338+

await expect(store.getSavedSync()).resolves.toEqual({

271339

nextBatch: "legacy-token",

272340

roomsData: {

273341

join: {},

342+

invite: {},

343+

leave: {},

344+

knock: {},

274345

},

275346

accountData: [],

276347

});