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

推荐订阅源

大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
小众软件
小众软件
V
V2EX
博客园 - Franky
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
量子位
博客园 - 【当耐特】
雷峰网
雷峰网
WordPress大学
WordPress大学
Jina AI
Jina AI
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
Visual Studio Blog
Microsoft Security Blog
Microsoft Security 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
fix(sqlite): disable WAL on network filesystems · opencla...
vincentkoc · 2026-06-16 · via Recent Commits to openclaw:main

@@ -73,7 +73,97 @@ describe("sqlite WAL maintenance", () => {

7373

}

7474

});

757576-

it("refuses NFS-backed databases when SQLite keeps WAL active", () => {

76+

it.each([

77+

["SMB", 0x517b],

78+

["CIFS", 0xff534d42],

79+

["SMB2", 0xfe534d42],

80+

])("uses rollback journaling for databases on Linux %s volumes", (_label, fsType) => {

81+

const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-sqlite-network-"));

82+

try {

83+

const db = createMockDb();

84+

vi.spyOn(fs, "statfsSync").mockReturnValue(statfsFixture(fsType));

85+86+

configureSqliteWalMaintenance(db, {

87+

checkpointIntervalMs: 0,

88+

databasePath: path.join(tempDir, "openclaw.sqlite"),

89+

});

90+91+

expect(db["prepare"]).toHaveBeenCalledWith("PRAGMA journal_mode = DELETE;");

92+

} finally {

93+

fs.rmSync(tempDir, { recursive: true, force: true });

94+

}

95+

});

96+97+

it.each([

98+

String.raw`\\server\share\openclaw.sqlite`,

99+

String.raw`\\?\UNC\server\share\openclaw.sqlite`,

100+

"//server/share/openclaw.sqlite",

101+

"//?/UNC/server/share/openclaw.sqlite",

102+

])("uses rollback journaling for databases on Windows UNC paths: %s", (databasePath) => {

103+

const db = createMockDb();

104+

vi.spyOn(process, "platform", "get").mockReturnValue("win32");

105+106+

configureSqliteWalMaintenance(db, {

107+

checkpointIntervalMs: 0,

108+

databasePath,

109+

});

110+111+

expect(db["prepare"]).toHaveBeenCalledWith("PRAGMA journal_mode = DELETE;");

112+

expect(db["exec"]).not.toHaveBeenCalled();

113+

});

114+115+

it("uses rollback journaling for mapped Windows network drives", () => {

116+

const db = createMockDb();

117+

const databasePath = String.raw`Z:\state\openclaw.sqlite`;

118+

vi.spyOn(process, "platform", "get").mockReturnValue("win32");

119+

const realpath = vi

120+

.spyOn(fs.realpathSync, "native")

121+

.mockReturnValue(String.raw`\\server\share\state\openclaw.sqlite`);

122+123+

configureSqliteWalMaintenance(db, {

124+

checkpointIntervalMs: 0,

125+

databasePath,

126+

});

127+128+

expect(realpath).toHaveBeenCalledWith(databasePath);

129+

expect(db["prepare"]).toHaveBeenCalledWith("PRAGMA journal_mode = DELETE;");

130+

expect(db["exec"]).not.toHaveBeenCalled();

131+

});

132+133+

it("does not treat namespaced Windows local drives as UNC paths", () => {

134+

const db = createMockDb();

135+

const databasePath = String.raw`\\?\C:\state\openclaw.sqlite`;

136+

vi.spyOn(process, "platform", "get").mockReturnValue("win32");

137+

const realpath = vi.spyOn(fs.realpathSync, "native").mockReturnValue(databasePath);

138+139+

configureSqliteWalMaintenance(db, {

140+

checkpointIntervalMs: 0,

141+

databasePath,

142+

});

143+144+

expect(realpath).toHaveBeenCalledWith(databasePath);

145+

expect(db["prepare"]).not.toHaveBeenCalled();

146+

expect(db["exec"]).toHaveBeenNthCalledWith(1, "PRAGMA journal_mode = WAL;");

147+

});

148+149+

it("uses rollback journaling when Windows cannot classify an opened drive path", () => {

150+

const db = createMockDb();

151+

const databasePath = String.raw`Z:\restricted\openclaw.sqlite`;

152+

vi.spyOn(process, "platform", "get").mockReturnValue("win32");

153+

vi.spyOn(fs.realpathSync, "native").mockImplementation(() => {

154+

throw new Error("access denied");

155+

});

156+157+

configureSqliteWalMaintenance(db, {

158+

checkpointIntervalMs: 0,

159+

databasePath,

160+

});

161+162+

expect(db["prepare"]).toHaveBeenCalledWith("PRAGMA journal_mode = DELETE;");

163+

expect(db["exec"]).not.toHaveBeenCalled();

164+

});

165+166+

it("refuses network-backed databases when SQLite keeps WAL active", () => {

77167

const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-sqlite-nfs-"));

78168

try {

79169

const db = createMockDb();

@@ -137,6 +227,29 @@ describe("sqlite WAL maintenance", () => {

137227

}

138228

});

139229230+

it("uses macOS SMB mount filesystem names", () => {

231+

const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-sqlite-smb-"));

232+

try {

233+

const db = createMockDb();

234+

vi.spyOn(fs, "statfsSync").mockReturnValue(statfsFixture(0));

235+

vi.spyOn(fs, "readFileSync").mockImplementation(() => {

236+

throw new Error("no proc mountinfo");

237+

});

238+

vi.spyOn(childProcess, "execFileSync").mockReturnValue(

239+

Buffer.from(`//server/share on ${tempDir} (smbfs, nodev, nosuid)\n`),

240+

);

241+242+

configureSqliteWalMaintenance(db, {

243+

checkpointIntervalMs: 0,

244+

databasePath: path.join(tempDir, "openclaw.sqlite"),

245+

});

246+247+

expect(db["prepare"]).toHaveBeenCalledWith("PRAGMA journal_mode = DELETE;");

248+

} finally {

249+

fs.rmSync(tempDir, { recursive: true, force: true });

250+

}

251+

});

252+140253

it("parses Linux mount command filesystem names when proc mountinfo is unavailable", () => {

141254

const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-sqlite-nfs-"));

142255

try {