fix(server): prove completed history before idle sleep (#18646)

Reviewed and verified at 592bce69c6.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip authored and GitHub committed 2026-11-03 12:37:25 -06:00
1 parent 367f29478d
commit ccc63ea458
44 files changed
+4100 -112

No files matched your search

+7 -4
View File
@@ -30,8 +30,10 @@ function resolveWithin(baseDir: string, objectKey: string): string {
async function statOrNull(filePath: string) {
try {
return await fs.stat(filePath);
} catch {
return null;
} catch (error) {
const code = (error as NodeJS.ErrnoException | null)?.code;
if (code === "ENOENT" || code === "ENOTDIR") return null;
throw error;
}
}
@@ -89,8 +91,9 @@ export function createLocalDiskStorageProvider(baseDir: string): StorageProvider
const filePath = resolveWithin(root, input.objectKey);
try {
await fs.unlink(filePath);
} catch {
// idempotent delete
} catch (error) {
const code = (error as NodeJS.ErrnoException | null)?.code;
if (code !== "ENOENT" && code !== "ENOTDIR") throw error;
}
},
};