fix: 시작·삭제된 토너먼트 액션이 안내 없이 실패하던 문제 정리 - #512
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 79 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough토너먼트 상태 오류에 대한 토스트 표시를 추가했습니다. 생성, 항목 수정, 이미지 등록, 초대 흐름에서 시작 상태와 삭제 상태를 분리하고 쿼리 무효화와 화면 이동을 조정했습니다. 링크 등록 응답 타입과 import 경로도 정리했습니다. Changes토너먼트 오류 처리
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: 🔵 Low · up to The change improves feedback when tournament actions fail, but one fallback error message is defined outside the shared message catalog, which may cause inconsistent or harder-to-localize wording. The PR is mergeable with explicit owner follow-up to centralize that message. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
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/_components/invite-friends/InviteFriendsDialog.tsx:
- Around line 106-110: InviteFriendsDialog의 inviteUrl 검증 경로에서 직접 사용한 토스트 문자열을
제거하세요. 해당 메시지를 공용 오류 카탈로그에 등록하고, 기존 API 오류 처리와 동일하게 getApiErrorMessage 또는 카탈로그의
공유 심볼을 통해 toast.error에 전달해 모든 오류 경로의 문구를 일관되게 관리하세요.
🪄 Autofix
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: c562e73e-e37b-4f5a-815c-a8f7553304eb
📒 Files selected for processing (11)
apps/web/src/apis/postTournamentItemLink.tsapps/web/src/app/tournament/[id]/_common/_hooks/useDeleteTournamentItem.tsapps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsxapps/web/src/app/tournament/[id]/create/_hooks/usePatchInviteExpiry.tsapps/web/src/app/tournament/[id]/create/_types/tournament.tsapps/web/src/app/tournament/[id]/create/by-wish/_hooks/usePostTournamentItemsByWish.tsapps/web/src/app/tournament/[id]/item/[itemId]/_hooks/usePatchTournamentItem.tsapps/web/src/components/get-item-dialog/ByLinkDialog.tsxapps/web/src/hooks/usePostTournamentItemLink.tsapps/web/src/hooks/usePostTournamentOCR.tsapps/web/src/types/tournament.ts
💤 Files with no reviewable changes (1)
- apps/web/src/app/tournament/[id]/create/_types/tournament.ts
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
작업 요약
작업 세부 내용
1. 시작된 토너먼트 담기 안내 (#488 본편)
토너먼트가 시작된 뒤 담기를 시도하면 서버는 409(
TOURNAMENT-005)를 내려주는데,usePostTournamentOCR(이미지로 담기)·usePostTournamentItemsByWish(위시에서 가져오기)의TOURNAMENT_NOT_PENDING분기가 토스트 없이 early return 하고 있었습니다. 에러 처리 정책(4xx는 빠짐없이 안내, invalidate·redirect는 그 위에 얹기)대로 분기 맨 앞에toast.error(getApiErrorMessage(error))를 추가했습니다.링크로 담기만 정상이었던 이유:
ByLinkDialog가showErrorToast: false+ per-mutateonError로 인라인 문구를 직접 그려서 훅의 침묵 분기를 우회하고 있었습니다.2. 남은 NOT_PENDING 침묵 분기 정리
같은 침묵 패턴이 있던 4곳에 안내를 추가했습니다.
usePostTournamentItemLink—showErrorToast옵션을 존중해if (showErrorToast) toast.error(...). 유일한 소비처(ByLinkDialog)는 인라인 안내라 이중 안내 없음usePatchTournamentItem/useDeleteTournamentItem/usePatchInviteExpiry— 토스트 추가 (기존 invalidate·redirect 동작 유지)join 경로(
usePostJoin·join 페이지·홈 초대 다이얼로그)는ALREADY_STARTED전용 다이얼로그로 이미 안내되고 있어 제외했습니다.3. 삭제된 토너먼트 NOT_FOUND 동선 통일
usePostTournamentItemsByWish·usePatchTournamentItem은TOURNAMENT_NOT_FOUND를NOT_PENDING과 한 분기로 묶어 create 화면으로만 replace 했는데, create로의 소프트 네비게이션은 404 → 홈 폴백을 담당하는tournament/[id]/layout.tsx(RSC)를 다시 실행시키지 않아 삭제된 토너먼트의 stale 화면에 안내 없이 머무는 문제가 있었습니다. 링크·이미지·삭제 훅과 동일하게 홈 replace +?action=tournament-not-found(루트QueryActionToast가 안내 표시)로 통일하고 분기를 분리했습니다.4. usePostTournamentItemLink 레벨업
components/get-item-dialog(홈·위시 보관함·토너먼트 create 3개 top-level 라우트 공유)가 라우트 private 훅app/tournament/[id]/create/_hooks/usePostTournamentItemLink를 import하고 있어 콜로케이션 규칙에 어긋났습니다. 훅은src/hooks/, API 함수는src/apis/, 응답 타입은src/types/tournament.ts로 이동했습니다 (OCR 훅과 동일한 배치).5. 공유 버튼 안전망
InviteFriendsDialog의 "초대 링크 보내기"가inviteUrl이 빈 값이면 침묵 early return 했습니다. 진입점 숨김·시트 자동 닫기는 #509에서 해결됐고, 여기서는 예상 못 한 경로로 시트가 열린 경우를 위한 안전망 토스트만 추가합니다.스크린샷
-.mov
-.mov
-.mov
연관 이슈
closes #488
Summary by CodeRabbit
버그 수정
개선