Skip to content

fix: 시작·삭제된 토너먼트 액션이 안내 없이 실패하던 문제 정리 - #512

Merged
iOdiO89 merged 7 commits into
devfrom
fix/488-already-started-tournament
Aug 13, 2026
Merged

fix: 시작·삭제된 토너먼트 액션이 안내 없이 실패하던 문제 정리#512
iOdiO89 merged 7 commits into
devfrom
fix/488-already-started-tournament

Conversation

@iOdiO89

@iOdiO89 iOdiO89 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

작업 요약

  • 시작된 토너먼트에 이미지로 담기·위시에서 가져오기 시 안내 토스트를 추가합니다
  • 아이템 수정·삭제, 초대 마감 변경, 링크 담기의 침묵 분기에도 같은 안내를 추가합니다
  • 삭제된 토너먼트에 액션 시 홈 폴백 + 안내 토스트로 동선을 통일합니다
  • 공유 다이얼로그가 쓰는 usePostTournamentItemLink 훅·API를 src/hooks·src/apis로 레벨업합니다
  • 초대 링크가 없는 상태에서 공유 버튼이 무반응이던 것에 안전망 토스트를 추가합니다

작업 세부 내용

1. 시작된 토너먼트 담기 안내 (#488 본편)

토너먼트가 시작된 뒤 담기를 시도하면 서버는 409(TOURNAMENT-005)를 내려주는데, usePostTournamentOCR(이미지로 담기)·usePostTournamentItemsByWish(위시에서 가져오기)의 TOURNAMENT_NOT_PENDING 분기가 토스트 없이 early return 하고 있었습니다. 에러 처리 정책(4xx는 빠짐없이 안내, invalidate·redirect는 그 위에 얹기)대로 분기 맨 앞에 toast.error(getApiErrorMessage(error))를 추가했습니다.

링크로 담기만 정상이었던 이유: ByLinkDialogshowErrorToast: false + per-mutate onError로 인라인 문구를 직접 그려서 훅의 침묵 분기를 우회하고 있었습니다.

2. 남은 NOT_PENDING 침묵 분기 정리

같은 침묵 패턴이 있던 4곳에 안내를 추가했습니다.

  • usePostTournamentItemLinkshowErrorToast 옵션을 존중해 if (showErrorToast) toast.error(...). 유일한 소비처(ByLinkDialog)는 인라인 안내라 이중 안내 없음
  • usePatchTournamentItem / useDeleteTournamentItem / usePatchInviteExpiry — 토스트 추가 (기존 invalidate·redirect 동작 유지)

join 경로(usePostJoin·join 페이지·홈 초대 다이얼로그)는 ALREADY_STARTED 전용 다이얼로그로 이미 안내되고 있어 제외했습니다.

3. 삭제된 토너먼트 NOT_FOUND 동선 통일

usePostTournamentItemsByWish·usePatchTournamentItemTOURNAMENT_NOT_FOUNDNOT_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

  • 버그 수정

    • 이미 시작된 토너먼트에서 초대 링크 전송, 초대 마감 시간 변경, 아이템 추가·수정·OCR 요청이 실패할 때 오류 메시지가 토스트로 표시됩니다.
    • 삭제된 토너먼트 접근 시 상황에 맞는 안내와 함께 홈 화면으로 이동합니다.
    • 토너먼트가 아직 시작되지 않은 경우 안내 후 생성 화면으로 이동하고 관련 정보가 갱신됩니다.
    • 초대 링크가 없는 경우에도 초대할 수 없는 사유를 안내합니다.
  • 개선

    • 토너먼트 관련 오류 상황별 화면 이동과 안내가 더욱 일관되게 처리됩니다.

@iOdiO89 iOdiO89 self-assigned this Aug 13, 2026
@iOdiO89 iOdiO89 added fix Something isn't working refactor Extra attention is needed WEB labels Aug 13, 2026
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
piki Ready Ready Preview Aug 13, 2026 4:55am

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@iOdiO89, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f4b09544-1286-49cd-b921-5436005c874a

📥 Commits

Reviewing files that changed from the base of the PR and between e393e16 and e9674a3.

📒 Files selected for processing (1)
  • apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx
📝 Walkthrough

Walkthrough

토너먼트 상태 오류에 대한 토스트 표시를 추가했습니다. 생성, 항목 수정, 이미지 등록, 초대 흐름에서 시작 상태와 삭제 상태를 분리하고 쿼리 무효화와 화면 이동을 조정했습니다. 링크 등록 응답 타입과 import 경로도 정리했습니다.

Changes

토너먼트 오류 처리

Layer / File(s) Summary
링크 등록 API 계약 및 훅 연결
apps/web/src/types/tournament.ts, apps/web/src/apis/postTournamentItemLink.ts, apps/web/src/hooks/usePostTournamentItemLink.ts
PostTournamentItemLinkResponseT를 공용 타입으로 추가했습니다. 링크 등록 API와 훅의 import 경로를 변경했습니다.
토너먼트 상태 오류 토스트
apps/web/src/app/tournament/[id]/_common/_hooks/useDeleteTournamentItem.ts, apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx, apps/web/src/app/tournament/[id]/create/_hooks/usePatchInviteExpiry.ts, apps/web/src/hooks/usePostTournamentItemLink.ts, apps/web/src/hooks/usePostTournamentOCR.ts
토너먼트 시작 또는 초대 불가 상태에서 API 오류 메시지를 토스트로 표시합니다.
상태별 무효화 및 이동
apps/web/src/app/tournament/[id]/create/by-wish/_hooks/usePostTournamentItemsByWish.ts, apps/web/src/app/tournament/[id]/item/[itemId]/_hooks/usePatchTournamentItem.ts
TOURNAMENT_NOT_PENDINGTOURNAMENT_NOT_FOUND를 분리했습니다. 시작 상태에서는 토스트, 쿼리 무효화, 생성 화면 이동을 수행합니다. 삭제 상태에서는 TOURNAMENT_NOT_FOUND 또는 관련 쿼리 파라미터와 함께 홈으로 이동합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: 🔵 Low · up to e393e

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

  • TeamPiKi/client#432: 동일한 토너먼트 오류 처리 훅과 컴포넌트를 수정합니다.
  • TeamPiKi/client#436: usePostTournamentOCR 및 토너먼트 오류 처리 훅을 수정합니다.
  • TeamPiKi/client#415: usePostTournamentItemLink의 조건부 오류 토스트 처리를 수정합니다.

Suggested reviewers: kanghaeun, ychany

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 시작되거나 삭제된 토너먼트 액션에 안내를 추가하는 주요 변경 사항을 명확하게 요약합니다.
Linked Issues check ✅ Passed 이미지 및 위시 아이템 추가의 TOURNAMENT_NOT_PENDING 분기에 오류 토스트를 추가해 [#488]의 요구 사항을 충족합니다.
Out of Scope Changes check ✅ Passed 변경 사항은 연결 이슈와 PR 목표에 포함된 토스트 추가, 삭제 처리, 초대 처리 및 관련 경로 정리에 해당합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/488-already-started-tournament

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다.

@github-actions
github-actions Bot requested a review from kanghaeun August 13, 2026 01:15
@iOdiO89

iOdiO89 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 697297a and e393e16.

📒 Files selected for processing (11)
  • apps/web/src/apis/postTournamentItemLink.ts
  • apps/web/src/app/tournament/[id]/_common/_hooks/useDeleteTournamentItem.ts
  • apps/web/src/app/tournament/[id]/create/_components/invite-friends/InviteFriendsDialog.tsx
  • apps/web/src/app/tournament/[id]/create/_hooks/usePatchInviteExpiry.ts
  • apps/web/src/app/tournament/[id]/create/_types/tournament.ts
  • apps/web/src/app/tournament/[id]/create/by-wish/_hooks/usePostTournamentItemsByWish.ts
  • apps/web/src/app/tournament/[id]/item/[itemId]/_hooks/usePatchTournamentItem.ts
  • apps/web/src/components/get-item-dialog/ByLinkDialog.tsx
  • apps/web/src/hooks/usePostTournamentItemLink.ts
  • apps/web/src/hooks/usePostTournamentOCR.ts
  • apps/web/src/types/tournament.ts
💤 Files with no reviewable changes (1)
  • apps/web/src/app/tournament/[id]/create/_types/tournament.ts

@iOdiO89
iOdiO89 merged commit 1aee4f4 into dev Aug 13, 2026
7 checks passed
@iOdiO89
iOdiO89 deleted the fix/488-already-started-tournament branch August 13, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Something isn't working refactor Extra attention is needed WEB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: 시작된 토너먼트에 이미지·위시로 담기 시도 시 안내 토스트가 없음

1 participant