Skip to content

fix(storage): verify Space ownership before deletion - #139

Open
Rio Yu (rioyu123) wants to merge 1 commit into
microsoft:mainfrom
rioyu123:codex/fix-delete-space-ownership
Open

fix(storage): verify Space ownership before deletion#139
Rio Yu (rioyu123) wants to merge 1 commit into
microsoft:mainfrom
rioyu123:codex/fix-delete-space-ownership

Conversation

@rioyu123

Copy link
Copy Markdown

Summary

  • resolve destructive blob cleanup from a fresh disk ownership scan
  • keep missing-id cleanup limited to an unowned .artifacts directory
  • require a matching space.json before recursively deleting a Space directory
  • protect alias collisions, Workspace-owned directories, and symlinked scope roots
  • release deletion admission when post-acquire validation fails

An absent stable id previously fell back to a literal directory name. If that name matched another Space's title-derived directory, the blob-first sweep and CanvasStore.destroy() could remove that Space even though its stable id was different. The same fallback could target setting/.

The normal read/write fallback remains unchanged. Only destructive resolution is ownership-aware, so legitimate stable-id deletion and cleanup of genuine orphan blobs keep their existing behavior.

Testing

  • storage module suite: 255 passed, 2 skipped
  • focused deletion/disk suite: 84 passed, 1 skipped
  • @huabu/server typecheck
  • ESLint on changed TypeScript files (no errors)

Closes #90

@rioyu123
Rio Yu (rioyu123) force-pushed the codex/fix-delete-space-ownership branch from 533832d to cd97f86 Compare August 27, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Deleting an absent Space id can delete another Space by directory-title alias

1 participant