Workspace Storage Usage Still Counts Soft-Deleted Files
Level 2 · node · Data · Soft-delete aggregation scope error
Scenario
A collaboration service calculates storage usage per workspace to decide whether uploads are allowed. File deletion uses soft delete by setting deletedAt for recovery, but usage does not decrease after deletion, so new uploads are rejected as over quota. The quota service only consumes the repository aggregate, while calculations for other workspaces and active files behave normally.
Requirements
- Include only active files whose deletedAt is null in storage usage - Exclude sizeBytes of soft-deleted files from the aggregate - Do not include files from other workspaces in the current workspace total - Return zero usage when there are no active files - Keep quota decisions based on the corrected active-file aggregate
Acceptance criteria
- Usage is correct for a workspace containing only active files
- Soft-deleted files are excluded from workspace usage
- Files in another workspace do not affect the total
- A workspace with no active files reports zero usage
- An upload within quota is allowed after deleted capacity is released