fix(project): race-safe batch scene preview import and close
Serialize updateProject and preview finalize, drain before pack/close, buffer zip entries, and abort finalize cleanly when leaving the project to avoid ENOENT on multi-image drops. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+7
-6
@@ -954,13 +954,14 @@ async function main() {
|
||||
const finalized = await projectStore.finalizeScenePreviewImport(sceneId, result.assetId);
|
||||
if (finalized.changed) {
|
||||
emitSessionState();
|
||||
emitScenePreviewImportProgress({
|
||||
sceneId,
|
||||
assetId: result.assetId,
|
||||
phase: 'done',
|
||||
project: finalized.project,
|
||||
});
|
||||
}
|
||||
// Always clear optimizing UI — including abort on project close (changed: false).
|
||||
emitScenePreviewImportProgress({
|
||||
sceneId,
|
||||
assetId: result.assetId,
|
||||
phase: 'done',
|
||||
...(finalized.changed && finalized.project ? { project: finalized.project } : {}),
|
||||
});
|
||||
} catch (e) {
|
||||
emitScenePreviewImportProgress({
|
||||
sceneId,
|
||||
|
||||
Reference in New Issue
Block a user