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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user