From 82e40fb3700acd7a62a76023ea9011cbfc2df6d4 Mon Sep 17 00:00:00 2001 From: "Pawla Abdul (Bot)" Date: Sun, 12 Apr 2026 23:35:29 +0000 Subject: [PATCH] Use fixed .tmp suffix for writeSettings temp file The mutex already serializes all writes, so the PID-based temp name is unnecessary. A fixed suffix matches writeStore and avoids orphaned temp files after a crash (a restarted process picks a new PID). Co-Authored-By: Paperclip --- server/src/services/adapter-plugin-store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/services/adapter-plugin-store.ts b/server/src/services/adapter-plugin-store.ts index 1e21acf2..5f5a9057 100644 --- a/server/src/services/adapter-plugin-store.ts +++ b/server/src/services/adapter-plugin-store.ts @@ -111,7 +111,7 @@ function readSettings(): AdapterSettings { function writeSettings(settings: AdapterSettings): void { ensureDirs(); - const tmpPath = `${ADAPTER_SETTINGS_PATH}.${process.pid}.tmp`; + const tmpPath = `${ADAPTER_SETTINGS_PATH}.tmp`; fs.writeFileSync(tmpPath, JSON.stringify(settings, null, 2), "utf-8"); fs.renameSync(tmpPath, ADAPTER_SETTINGS_PATH); settingsCache = settings;