Skip to content

Commit a80cc8b

Browse files
waleedlatif1claude
andcommitted
fix(folders): handle missing parent folder during restore reparenting
If the parent folder row no longer exists (not just archived), the restored folder now correctly gets reparented to root instead of retaining a dangling parentId reference. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 47e0ea2 commit a80cc8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/sim/lib/workflows/orchestration/folder-lifecycle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ export async function performRestoreFolder(
299299
.from(workflowFolder)
300300
.where(eq(workflowFolder.id, folder.parentId))
301301

302-
if (parentFolder?.archivedAt) {
302+
if (!parentFolder || parentFolder.archivedAt) {
303303
await tx
304304
.update(workflowFolder)
305305
.set({ parentId: null })

0 commit comments

Comments
 (0)