Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: wait out transient Windows file locks

[._.]/ Adam Eivyd139829972ef
diff --git a/server/lib/fileCore.js b/server/lib/fileCore.js
index 8b74bac9b8..6efc2e4954 100644
--- a/server/lib/fileCore.js
+++ b/server/lib/fileCore.js
@@ -35,7 +35,7 @@ const isWindows = () => process.platform === 'win32';
// to avoid both the writer's destination-missing backup swap and the reader's
// phantom "nothing here yet".
const WIN_RETRY_ATTEMPTS = 5;
-const WIN_RETRY_DELAY_MS = 10;
+const WIN_RETRY_DELAY_MS = 100;
// rename(2) failures that mean "the destination is momentarily locked", not
// "this rename can never work".
const WIN_RENAME_LOCK_CODES = ['EPERM', 'EACCES', 'EEXIST', 'EBUSY'];
diff --git a/server/lib/imageThumbnail.test.js b/server/lib/imageThumbnail.test.js
index d8e5483aa0..9f7e2c5e8f 100644
--- a/server/lib/imageThumbnail.test.js
+++ b/server/lib/imageThumbnail.test.js
@@ -13,7 +13,7 @@ vi.mock('sharp', async (original) => {
const { default: sharp } = await import('sharp');
const { ensureImageThumbnail } = await import('./imageThumbnail.js');
-afterAll(() => rmSync(tempRoot, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 }));
+afterAll(() => rmSync(tempRoot, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 }));
beforeEach(() => { sharpCalls.count = 0; });
async function source(name) {
diff --git a/server/routes/brainCollectionPagination.test.js b/server/routes/brainCollectionPagination.test.js
index cf74ede09f..dba3583121 100644
--- a/server/routes/brainCollectionPagination.test.js
+++ b/server/routes/brainCollectionPagination.test.js
@@ -97,7 +97,7 @@ describe('Brain collection pagination (synthetic thousands-record fixtures)', ()
});
afterAll(() => {
- if (tempRoot) rmSync(tempRoot, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 });
+ if (tempRoot) rmSync(tempRoot, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });
});
describe('Inbox pagination & bounds', () => {
diff --git a/server/services/assetMounts.test.js b/server/services/assetMounts.test.js
index 9637db92ef..b20f8601b2 100644
--- a/server/services/assetMounts.test.js
+++ b/server/services/assetMounts.test.js
@@ -28,7 +28,7 @@ const tempRoot = createTempDataRoot('portos-asset-mounts-');
vi.mock('../lib/fileUtils.js', async (importOriginal) => (
makePathsProxy(await importOriginal(), { dataRoot: tempRoot })
));
-afterAll(() => rmSync(tempRoot, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 }));
+afterAll(() => rmSync(tempRoot, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 }));
// Dynamic, not a static import: the `vi.mock` factory above closes over
// `tempRoot`, and a static import would be hoisted above that binding.