You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(folders): route kb and table cascades through their canonical delete
Review found three ways the generic cascade diverged from the behavior each
resource defines for itself.
- Deleting an already-archived folder stamped its still-active children with
a fresh timestamp while the folder row kept the original. Restore matches
the folder's stamp, so those children were stranded permanently. Delete now
reuses the folder's existing deletedAt.
- A knowledge base is more than its own row: deleteKnowledgeBase also archives
its documents and pauses its connectors. The generic row update left that
graph live, so a connector kept syncing into a KB the UI showed as deleted.
The kb config now delegates to the canonical delete and restore.
- deleteTable refuses to archive a delete-locked table, because archiving
destroys access to every row. Deleting the folder around it bypassed that
control entirely. Tables now declare a guardDelete that refuses the whole
folder up front, so the cascade never archives half a subtree and then stops.
deleteKnowledgeBase and deleteTable gain an optional archivedAt so a bulk
caller can stamp one shared timestamp, matching archiveWorkflow's existing
option; single-resource callers are unchanged. Adds the restoreChildren hook
that pairs with archiveChildren, sequenced after the folder transaction commits
since the canonical restores open their own.
Also: make resourceType a required argument on deduplicateFolderName and
listFoldersForWorkspace so a future caller cannot silently operate on the
workflow tree, and give folder routes one shared status mapper rather than
three copies that already disagreed.
0 commit comments