feat: 워크스페이스 소유권 이전 및 삭제 기능 추가 (#87) - #90
Conversation
- transfer_workspace_ownership RPC 추가 (security definer, 행 잠금으로 동시 탈퇴 레이스 차단) - deleteWorkspace 서버액션 추가 (owner 검증 -> Storage 정리 -> DB 삭제, 멤버 수 무관하게 owner면 항상 가능) - 설정 페이지를 워크스페이스 관리/팀 관리/프로필 설정 탭으로 재구성 - 소유권 이전/워크스페이스 삭제 후 react-query 캐시 무효화 처리
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthrough워크스페이스 소유권 이전과 삭제 서버 액션, 관련 Supabase RPC 및 Storage 정리 절차, 설정 화면의 조건부 관리 UI와 소유자 탈퇴 안내를 추가했습니다. Changes워크스페이스 소유권 관리
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Owner
participant SettingsView
participant TransferOwnershipDialog
participant transferOwnership
participant transfer_workspace_ownership
Owner->>SettingsView: 팀 관리 탭 열기
SettingsView->>TransferOwnershipDialog: 다른 멤버 목록 전달
Owner->>TransferOwnershipDialog: 새 소유자 선택
TransferOwnershipDialog->>transferOwnership: 소유권 이전 요청
transferOwnership->>transfer_workspace_ownership: RPC 호출
transfer_workspace_ownership-->>transferOwnership: 역할과 owner_id 갱신
transferOwnership-->>TransferOwnershipDialog: 성공 응답
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/entities/workspace/api/delete-workspace.ts`:
- Around line 66-118: Update the deleteWorkspace flow to acquire the same
row-level lock used by transfer_workspace_ownership before validating ownership
or deleting Storage files, keeping the existing requirement that Storage cleanup
precedes workspace-row deletion. Use a security-definer RPC or equivalent SELECT
... FOR UPDATE operation that holds the lock through the entire Storage listing,
batch removal, and final database delete, and ensure ownership validation and
deletion occur under that lock.
In `@src/features/manage-workspace-info/ui/DeleteWorkspaceDialog.tsx`:
- Around line 96-103: Update the delete button in DeleteWorkspaceDialog’s
handleDelete flow to expose an accessible loading state when isDeleting is true,
using an appropriate aria-label or aria-busy attribute while preserving the
existing visual spinner and button behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 3002e2de-fd9b-4aaa-9d22-7239d7ac9640
📒 Files selected for processing (14)
src/entities/workspace/api/delete-workspace.tssrc/entities/workspace/api/transfer-ownership.tssrc/entities/workspace/index.tssrc/features/manage-member-profile/ui/MemberProfileForm.tsxsrc/features/manage-workspace-info/index.tssrc/features/manage-workspace-info/ui/DeleteWorkspaceDialog.tsxsrc/features/manage-workspace-info/ui/DeleteWorkspaceSection.tsxsrc/features/manage-workspace-members/index.tssrc/features/manage-workspace-members/ui/OwnershipTransferSection.tsxsrc/features/manage-workspace-members/ui/TransferOwnershipDialog.tsxsrc/shared/model/database.types.tssrc/views/settings/model/settings-tab.tssrc/views/settings/ui/SettingsView.tsxsupabase/migrations/20260722000000_create_workspace_ownership_transfer_rpc.sql
918d942 to
6be9369
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/entities/workspace/api/delete-workspace.ts`:
- Around line 81-92: Update cleanupWorkspaceStorage to filter
listAllStorageFileNames results to actual files with id !== null, excluding
folder placeholder entries. Continue looping only when the removal operation
deletes files and stop when no removable files remain, preventing an infinite
loop on unchanged listings.
In `@supabase/migrations/20260723000000_create_workspace_deletion_jobs.sql`:
- Line 12: Remove the explicit begin; and matching commit; statements from the
migration so Supabase CLI controls the transaction boundary and all migration
statements execute within its atomic transaction.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 73de3ef0-bfe9-4669-8dfb-5e7cb552fca1
📒 Files selected for processing (6)
src/entities/workspace/api/delete-workspace.tssrc/features/manage-member-profile/ui/MemberProfileForm.tsxsrc/features/manage-workspace-info/ui/DeleteWorkspaceDialog.tsxsrc/features/manage-workspace-members/ui/TransferOwnershipDialog.tsxsrc/shared/model/database.types.tssupabase/migrations/20260723000000_create_workspace_deletion_jobs.sql
Pull Request
작업 내용
작업 결과
변경 사항
Added
transfer_workspace_ownershipRPC(security definer) 및 소유권 이전 서버 액션/UIChanged
/workspaces목록의 react-query 캐시를 무효화하도록 수정Fixed
실행화면
테스트
리뷰 체크리스트
feature/*->develop, 배포 시develop또는release/*->main)Type/#issue-number/description형식을 따릅니다.console.log, 주석, 임시 코드를 제거했습니다.리뷰 요청사항
관련 이슈
Closes #87
Summary by CodeRabbit
Summary by CodeRabbit