Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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>
  • Loading branch information
waleedlatif1 and claude committed Apr 7, 2026
commit a80cc8b23de34fc419b5da1ad4a7f3e1a1ac7b6d
2 changes: 1 addition & 1 deletion apps/sim/lib/workflows/orchestration/folder-lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export async function performRestoreFolder(
.from(workflowFolder)
.where(eq(workflowFolder.id, folder.parentId))

if (parentFolder?.archivedAt) {
if (!parentFolder || parentFolder.archivedAt) {
await tx
.update(workflowFolder)
.set({ parentId: null })
Expand Down
Loading