refactor(trash): optimize cascade delete CTE queries and add rigorous edge-case tests

- Extracted recursive CTE cascade update to cascadeStatusToPendingPurge private helper

- Updated emptyTrash and expireTrashedAssets background job to use batch helper

- Added expireTrashedAssets GC test to verify date boundaries and recursive child marking

- Resolved typecast any warning in test
This commit is contained in:
yiling
2026-06-11 16:40:21 +08:00
parent 8bd34904ff
commit 5835c36cb5
3 changed files with 117 additions and 31 deletions
@@ -838,7 +838,9 @@ export function FileBrowser({
<Button
variant="destructive"
size="sm"
disabled={isEmptyingTrash || (folders.length === 0 && displayedFiles.length === 0)}
disabled={
isEmptyingTrash || (folders.length === 0 && displayedFiles.length === 0)
}
onClick={() => setIsEmptyTrashDialogOpen(true)}
className="h-8 px-3 text-xs font-medium bg-destructive/10 text-destructive border border-destructive/20 hover:bg-destructive hover:text-destructive-foreground transition-all duration-200"
>