fix(project): stabilize project deletion

- Guard renderer project list/get against stale initial loads
- Retry project zip/cache removal to handle transient Windows locks
- Surface deletion failures in UI and add regression tests

Made-with: Cursor
This commit is contained in:
Ivan Fontosh
2026-04-22 15:12:25 +08:00
parent add699a320
commit ffce066842
8 changed files with 136 additions and 34 deletions
+3 -2
View File
@@ -24,6 +24,7 @@ import { asAssetId, asGraphNodeId, asProjectId } from '../../shared/types/ids';
import { getAppSemanticVersion } from '../versionInfo';
import { reconcileAssetFiles } from './assetPrune';
import { rmWithRetries } from './fsRetry';
import { getLegacyProjectsRootDirs, getProjectsCacheRootDir, getProjectsRootDir } from './paths';
import { readProjectJsonFromZip, unzipToDir } from './yauzlProjectZip';
@@ -792,8 +793,8 @@ export class ZipProjectStore {
this.projectSession += 1;
}
await fs.rm(zipPath, { force: true }).catch(() => undefined);
await fs.rm(cacheDir, { recursive: true, force: true }).catch(() => undefined);
await rmWithRetries(fs.rm, zipPath, { force: true });
await rmWithRetries(fs.rm, cacheDir, { recursive: true, force: true });
}
private randomId(): string {