refactor: 토너먼트 시작 409 시 match 페이지로 복구 이동#331
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough토너먼트 시작 mutation에 Axios 에러 판별과 API 에러 응답 타입을 적용했습니다. 409 응답은 매치 화면으로 이동하고, 500 미만 응답은 API 에러 메시지를 토스트로 표시합니다. Changes토너먼트 시작 에러 처리
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@apps/web/src/app/tournament/`[id]/create/_hooks/usePostTournamentStart.ts:
- Around line 40-41: Update the status condition in the error handling around
getApiErrorMessage to show a toast only for 4xx responses, using a range check
from 400 inclusive to 500 exclusive; preserve the existing behavior that
excludes status 409 if handled elsewhere.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a24ddfa1-e53f-4960-9248-bb0bca7dee1a
📒 Files selected for processing (1)
apps/web/src/app/tournament/[id]/create/_hooks/usePostTournamentStart.ts
| if (status < 500) { | ||
| toast.error(getApiErrorMessage(error)); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
토스트 처리를 4xx 응답으로 제한해 주세요.
status < 500은 3xx 또는 1xx 응답까지 포함하므로, PR 요구사항인 “409 이외의 4xx 오류만 토스트 표시”보다 범위가 넓습니다. status >= 400 && status < 500으로 제한하는 편이 안전합니다.
🤖 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 `@apps/web/src/app/tournament/`[id]/create/_hooks/usePostTournamentStart.ts
around lines 40 - 41, Update the status condition in the error handling around
getApiErrorMessage to show a toast only for 4xx responses, using a range check
from 400 inclusive to 500 exclusive; preserve the existing behavior that
excludes status 409 if handled elsewhere.
f26afd5 to
4a33e36
Compare
* refactor: 토너먼트 시작 409 시 match 페이지로 복구 이동 * refactor: 4xx 에러 문구를 getApiErrorMessage 유틸로 통일
작업 요약
작업 세부 내용
status code 대응 전수조사에서 확인된 잔여 항목 처리입니다.
조사 항목 중 대부분(빈
onError제거, 502 포함 5xx 일괄 처리, generic 토스트)은 #311 에서 이미 해결되었고, 남은 작업인 시작 버튼의 409 맞춤 복구 UX 작업을 진행했습니다.useDeleteTournament— 주석 처리된 빈onError는 #311에서 이미 제거됨. 409 포함 4xx는 전역 fallback이 서버detail토스트로 처리하므로 변경 없음usePostCreateTournament—onError없음 → 전역 generic 토스트가 커버. 맞춤 UX 불필요로 closeusePostTournamentStart에onError추가router.push(TOURNAMENT_MATCH)로 이동합니다. match 페이지 서버 컴포넌트가 최신 상태를 조회해 상태별 복구(COMPLETED → 결과 페이지 redirect, IN_PROGRESS → 매치 진행)를 이미 담당하고 있어 해당 로직을 재활용합니다.onError를 정의하면 전역 4xx fallback이 스킵되므로, 기존 패턴(usePostTournamentItemLink)대로 서버detail토스트를 훅 내에서 재현했습니다.연관 이슈
closes #301
Summary by CodeRabbit