feat: add seedFolderMtimes API for seeding file modification times during folder synchronization

This commit is contained in:
Anish Sarkar 2026-04-08 16:07:25 +05:30
parent e8c2377824
commit d009d06432
6 changed files with 48 additions and 0 deletions

View file

@ -212,5 +212,15 @@ export async function uploadFolderScan(params: FolderSyncParams): Promise<number
params.onProgress?.({ phase: "done", uploaded: entriesToUpload.length, total: entriesToUpload.length });
// Seed the Electron mtime store so the reconciliation scan in
// startWatcher won't re-emit events for files we just indexed.
if (api.seedFolderMtimes) {
const mtimes: Record<string, number> = {};
for (const f of allFiles) {
mtimes[f.relativePath] = f.mtimeMs;
}
await api.seedFolderMtimes(folderPath, mtimes);
}
return rootFolderId;
}