fix:근무 유형 및 업무 보드 RPC 보정(#68) - #68
Conversation
|
Warning Review limit reached
Next review available in: 40 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 (5)
📝 WalkthroughWalkthrough업무 생성·보드 정렬 RPC가 인증 사용자와 워크스페이스 멤버십을 검증하도록 변경되었습니다. 보드 상태값은 DB enum 형식으로 정규화되며, 근무유형 이름 중복 처리와 중복 오류 메시지가 보완되었습니다. ChangesRPC 보정
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant TaskBoard
participant updateTaskBoard
participant update_task_board
participant tasks
TaskBoard->>updateTaskBoard: 상태와 정렬 순서 전달
updateTaskBoard->>updateTaskBoard: UI 상태를 DB 상태로 변환
updateTaskBoard->>update_task_board: p_workspace_id, p_tasks 전달
update_task_board->>tasks: task 상태와 sort_order 갱신
tasks-->>update_task_board: 갱신 행 수 반환
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: 3
🤖 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/work-schedule/api/work-schedule-actions.ts`:
- Around line 118-124: Update the work-schedule creation and update error flow
around the action’s duplicate-name handling and the WorkScheduleBoard.tsx
create/edit handlers so the handlers receive and display the user-facing
duplicate-name message instead of always showing a fixed toast. Preserve generic
error handling for other failures, and expose only a safe error code or message
suitable for UI branching.
In `@supabase/migrations/20260716000000_fix_work_shift_type_default_name.sql`:
- Line 2: Remove the explicit transaction boundaries from the migration by
deleting the BEGIN statement at the start and its matching COMMIT statement at
the end. Leave the migration statements and ordering unchanged so transaction
management remains with the migration runner.
In `@supabase/migrations/20260716010000_secure_task_rpcs.sql`:
- Line 2: 마이그레이션 파일의 중첩 트랜잭션을 제거하세요.
supabase/migrations/20260716010000_secure_task_rpcs.sql의 2-2와 126-126에서 각각
begin과 commit을 삭제하고,
supabase/migrations/20260716020000_normalize_task_board_status.sql의 2-2와
59-59에서도 각각 begin과 commit을 삭제하여 마이그레이션 도구가 트랜잭션을 관리하도록 하세요.
🪄 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: ef32be6a-a253-46da-8d70-b963f2db94de
📒 Files selected for processing (8)
src/entities/task/api/create-task.tssrc/entities/task/api/update-task-board.tssrc/entities/work-schedule/api/work-schedule-actions.tssupabase/migrations/20260714024702_make_work_shift_creation_atomic.sqlsupabase/migrations/20260714100000_create_task_rpcs_and_restrict_browser_rls.sqlsupabase/migrations/20260716000000_fix_work_shift_type_default_name.sqlsupabase/migrations/20260716010000_secure_task_rpcs.sqlsupabase/migrations/20260716020000_normalize_task_board_status.sql
💤 Files with no reviewable changes (1)
- src/entities/task/api/create-task.ts
| @@ -0,0 +1,126 @@ | |||
| -- 원격 DB에 누락된 태스크 RPC를 추가하고, 생성자 식별을 auth.uid() 기준으로 고정한다. | |||
| begin; | |||
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
마이그레이션 파일 내부의 중첩 트랜잭션을 제거하세요.
마이그레이션 도구가 관리하는 트랜잭션을 직접 커밋하면 스키마 적용과 이력 기록의 원자성이 깨질 수 있습니다.
supabase/migrations/20260716010000_secure_task_rpcs.sql#L2-L2:begin을 제거하세요.supabase/migrations/20260716010000_secure_task_rpcs.sql#L126-L126:commit을 제거하세요.supabase/migrations/20260716020000_normalize_task_board_status.sql#L2-L2:begin을 제거하세요.supabase/migrations/20260716020000_normalize_task_board_status.sql#L59-L59:commit을 제거하세요.
🧰 Tools
🪛 Squawk (2.59.0)
[warning] 2-2: There is an existing transaction already in progress, managed by your migration tool. Put migration statements in separate files to have them be in separate transactions or don't use the assume-in-transaction setting.
(transaction-nesting)
📍 Affects 2 files
supabase/migrations/20260716010000_secure_task_rpcs.sql#L2-L2(this comment)supabase/migrations/20260716010000_secure_task_rpcs.sql#L126-L126supabase/migrations/20260716020000_normalize_task_board_status.sql#L2-L2supabase/migrations/20260716020000_normalize_task_board_status.sql#L59-L59
🤖 Prompt for 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.
In `@supabase/migrations/20260716010000_secure_task_rpcs.sql` at line 2, 마이그레이션
파일의 중첩 트랜잭션을 제거하세요. supabase/migrations/20260716010000_secure_task_rpcs.sql의
2-2와 126-126에서 각각 begin과 commit을 삭제하고,
supabase/migrations/20260716020000_normalize_task_board_status.sql의 2-2와
59-59에서도 각각 begin과 commit을 삭제하여 마이그레이션 도구가 트랜잭션을 관리하도록 하세요.
Source: Linters/SAST tools
Pull Request
작업 내용
in-progress)를 DB enum 값(in_progress)으로 변환해 정렬 저장이 실패하지 않도록 수정했습니다.auth.uid()기반으로 정리했습니다.작업 결과
새 근무,새 근무 2처럼 고유한 이름으로 생성됩니다.진행 중열로 이동해도task_statusenum 변환 오류가 발생하지 않습니다.변경 사항
Added
Changed
Fixed
id컬럼 모호성 및 기본 이름 중복 오류in-progressenum 변환 오류실행화면
테스트
npm run lintnpm run typecheckgit diff --check리뷰 요청사항
20260716000000,20260716010000,20260716020000마이그레이션으로 안전하게 보정하는 흐름을 확인 부탁드립니다.관련 이슈
Closes #68
Summary by CodeRabbit
새 기능
버그 수정